begin
var n := ReadInteger('n =');
var s := n.ToString;
var sum := 0;
foreach var x in s do
if x in ['4', '8'] then sum += x.ToDigit;
sum.Println;
end.
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
begin
var n := ReadInteger('n =');
var s := n.ToString;
var sum := 0;
foreach var x in s do
if x in ['4', '8'] then sum += x.ToDigit;
sum.Println;
end.