var n, i : integer;
begin
i := 0;
readln(n);
n := abs(n);
while n > 0 do
i := i + n mod 10;
n := n div 10;
end;
writeln(i);
end.
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
var n, i : integer;
begin
i := 0;
readln(n);
n := abs(n);
while n > 0 do
begin
i := i + n mod 10;
n := n div 10;
end;
writeln(i);
end.