var
s,pr,x : integer;
begin
readln(x);
x := abs(x);
s:= 0;
pr:= 1;
while x > 0 do
s := s + x mod 10;
pr := pr * x mod 10;
x:= x div 10;
end;
writeln('S = ',s);
writeln('PR = ',pr);
end.
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
var
s,pr,x : integer;
begin
readln(x);
x := abs(x);
s:= 0;
pr:= 1;
while x > 0 do
begin
s := s + x mod 10;
pr := pr * x mod 10;
x:= x div 10;
end;
writeln('S = ',s);
writeln('PR = ',pr);
end.