Ответ:
program aaa;
var
numb,s,mult: integer;
begin
read(numb);
if (numb mod 2 = 0) or (numb mod 7 = 0)then
while numb > 0 do
s := s + numb mod 10;
numb := numb div 10;
end;
writeln(s);
end
else
mult := 1;
mult := mult * (numb mod 10);
numb := numb div 10
writeln(mult);
end.
Объяснение:
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Ответ:
program aaa;
var
numb,s,mult: integer;
begin
read(numb);
if (numb mod 2 = 0) or (numb mod 7 = 0)then
begin
while numb > 0 do
begin
s := s + numb mod 10;
numb := numb div 10;
end;
writeln(s);
end
else
mult := 1;
while numb > 0 do
begin
mult := mult * (numb mod 10);
numb := numb div 10
end;
writeln(mult);
end.
Объяснение: