Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
24
Task/Count-in-octal/Delphi/count-in-octal.delphi
Normal file
24
Task/Count-in-octal/Delphi/count-in-octal.delphi
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
program CountingInOctal;
|
||||
|
||||
{$APPTYPE CONSOLE}
|
||||
|
||||
uses SysUtils;
|
||||
|
||||
function DecToOct(aValue: Integer): string;
|
||||
var
|
||||
lRemainder: Integer;
|
||||
begin
|
||||
Result := '';
|
||||
repeat
|
||||
lRemainder := aValue mod 8;
|
||||
Result := IntToStr(lRemainder) + Result;
|
||||
aValue := aValue div 8;
|
||||
until aValue = 0;
|
||||
end;
|
||||
|
||||
var
|
||||
i: Integer;
|
||||
begin
|
||||
for i := 0 to 20 do
|
||||
WriteLn(DecToOct(i));
|
||||
end.
|
||||
Loading…
Add table
Add a link
Reference in a new issue