Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program armstrongovocislo;
- {$APPTYPE CONSOLE}
- uses SysUtils;
- type cifry=0..9;
- max=0..10000;
- var cf:cifry;
- c,i,t:max;
- begin
- { TODO -oUser -cConsole Main : Insert code here }
- write('Armstrongove cisla v intervale 1-10000 su: ');
- for i:=1 to 10000 do
- begin
- t:=0;
- c:=i;
- while c<>0 do
- begin
- cf:=c mod 10;
- c:=c div 10;
- t:=t+(cf*cf*cf);
- end;
- if i=t then write(i,', ');
- end;
- readln;
- end.
Advertisement
Add Comment
Please, Sign In to add comment