Uses crt;
Var
n,n1,n2,n3,n4,i,Armst:integer;
Begin
Write('Введите n: '); readln(n);
Write('Числа Армстронга для n=',n,': ');
if n=3 then
for i:=100 to 999 do begin
n1:=i div 100;
n2:=i mod 100 div 10;
n3:=i mod 10;
Armst:=(n1*n1*n1)+(n2*n2*n2)+(n3*n3*n3);
if Armst = i then write(Armst,' ');
end;
if n=4 then
for i:=1000 to 9999 do begin
n1:=i div 1000;
n2:=i div 100 mod 10;
n3:=i mod 100 div 10;
n4:=i mod 10;
Armst:=(n1*n1*n1*n1)+(n2*n2*n2*n2)+(n3*n3*n3*n3)+(n4*n4*n4*n4);
if Armst = i then write(Armst,' ');
end;
Writeln;
Readkey;
End.