program tong_tich;
uses crt;
var n,so,tong,tich:longint;
begin
clrscr;
write('Nhap n: '); readln(n);
tong:=0; tich:=1;
while n<>0 do
begin
so:=n mod 10;
tong:=tong+so;
tich:=tich*so;
n:=n div 10;
end;
writeln('Tong cac chu so la: ',tong);
writeln('Tich cac chu so la: ',tich);
readln;
end.