Data update
This commit is contained in:
parent
29a5eea0d4
commit
5c1bb7bfa9
2011 changed files with 35081 additions and 3229 deletions
|
|
@ -0,0 +1,17 @@
|
|||
function SumDigits(n, base: integer): integer;
|
||||
begin
|
||||
var sum := 0;
|
||||
while n > 0 do
|
||||
begin
|
||||
sum += n mod base;
|
||||
n := n div base;
|
||||
end;
|
||||
Result := sum;
|
||||
end;
|
||||
|
||||
begin
|
||||
Print(SumDigits(1, 10));
|
||||
Print(SumDigits(1234, 10));
|
||||
Print(SumDigits($FE, 16));
|
||||
Print(SumDigits($F0E, 16));
|
||||
end.
|
||||
Loading…
Add table
Add a link
Reference in a new issue