var
d, k: integer;
begin
write('Запишите число: ');
readln(d);
while d > 0 do
k := k + (d mod 10);
d := d div 10;
end;
writeln(k);
end.
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
var
d, k: integer;
begin
write('Запишите число: ');
readln(d);
while d > 0 do
begin
k := k + (d mod 10);
d := d div 10;
end;
writeln(k);
end.