Program zad;
var
n: longint;
sum: integer;
begin
readln(n);
sum := 0;
while n > 0 do begin
if n mod 10 mod 2 = 0 then
sum := sum + n mod 10;
n := n div 10;
end;
writeln(sum);
end.
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Program zad;
var
n: longint;
sum: integer;
begin
readln(n);
sum := 0;
while n > 0 do begin
if n mod 10 mod 2 = 0 then
sum := sum + n mod 10;
n := n div 10;
end;
writeln(sum);
end.