Программа:
Pascal:
var
n, i: integer;
begin
write('n = '); readln(n);
repeat
i := i + n mod 10;
n := n div 10
until n = 0;
writeln(i);
end.
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Verified answer
Программа:
Pascal:
var
n, i: integer;
begin
write('n = '); readln(n);
repeat
i := i + n mod 10;
n := n div 10
until n = 0;
writeln(i);
end.