Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
19
Task/Binary-digits/Delphi/binary-digits.delphi
Normal file
19
Task/Binary-digits/Delphi/binary-digits.delphi
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
program BinaryDigit;
|
||||
{$APPTYPE CONSOLE}
|
||||
uses
|
||||
sysutils;
|
||||
|
||||
function IntToBinStr(AInt : LongWord) : string;
|
||||
begin
|
||||
Result := '';
|
||||
repeat
|
||||
Result := Chr(Ord('0')+(AInt and 1))+Result;
|
||||
AInt := AInt div 2;
|
||||
until (AInt = 0);
|
||||
end;
|
||||
|
||||
Begin
|
||||
writeln(' 5: ',IntToBinStr(5));
|
||||
writeln(' 50: ',IntToBinStr(50));
|
||||
writeln('9000: '+IntToBinStr(9000));
|
||||
end.
|
||||
Loading…
Add table
Add a link
Reference in a new issue