uses crt;
var n,i,d,t,x,y:integer;
st:string;
begin
clrscr;
write('Nhap n='); readln(n);
str(n,st);
d:=length(st);
t:=0;
for i:=1 to d do
begin
val(st[i],x,y);
t:=t+x;
end;
writeln(n,' co ',d,' chu so');
writeln('Tong cac chu so cua ',n,' la: ',t);
readln;
end.
Program HOC24;
var n,i,d,t: integer;
begin
write('Nhap n:'); readln(n);
while n<>0 do
begin
t:=t+(n mod 10);
d:=d+1;
n:=n div 10;
end;
writeln('Co ',d,' so chu so');
write('Tong cac chu so la : ',t );
readln
end.