Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Program CPascal;
- var i,temp,sum:integer;
- Begin
- for i:=1 to 500 do
- Begin
- Temp:=i;
- Sum:=0;
- While (Temp > 0) do
- Begin
- Inc(Sum,Sqr(Temp mod 10));
- Temp:=Temp div 10;
- end;
- if (Sum = 24) then Writeln(i);
- end;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement