Advertisement
Alex_Fomin

iol 86k

Nov 5th, 2015
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.29 KB | None | 0 0
  1. Program CPascal;
  2.  
  3. var i,temp,sum:integer;
  4.  
  5. Begin
  6. for i:=1 to 500 do
  7.     Begin
  8.     Temp:=i;
  9.     Sum:=0;
  10.    
  11.     While (Temp > 0) do
  12.           Begin
  13.           Inc(Sum,Sqr(Temp mod 10));
  14.           Temp:=Temp div 10;
  15.           end;
  16.  
  17.     if (Sum = 24) then Writeln(i);
  18.     end;
  19. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement