Data update
This commit is contained in:
parent
81fd053722
commit
52a6ef48dd
10248 changed files with 63654 additions and 6775 deletions
|
|
@ -0,0 +1,17 @@
|
|||
function halve(x: integer): integer := x div 2;
|
||||
function double(x: integer): integer := x * 2;
|
||||
function odd(x: integer): boolean := x mod 2 <> 0;
|
||||
|
||||
function ethiopian(x, y: integer): integer;
|
||||
begin
|
||||
while x >= 1 do
|
||||
begin
|
||||
if odd(x) then result += y;
|
||||
x := halve(x);
|
||||
y := double(y);
|
||||
end;
|
||||
end;
|
||||
|
||||
begin
|
||||
ethiopian(17, 34).println;
|
||||
end.
|
||||
Loading…
Add table
Add a link
Reference in a new issue