user crt;
var n,t,demchuso,tong: integer
BEGIN
clrscr;
write('Nhap n:');
readln(n);
t:=n;
tong:=0;
demchuso:=0;
repeat
tong:=tong+t mod 10;
demchuso:=demchuso+1;
t:=t/10;
until t=0;
writeln(n,'co',demchuso,'chu so');
writeln('va tong chu so',tong);
END.
Friday, March 9, 2007
Subscribe to:
Posts (Atom)