Function HH(a: longint):boolean; Var s,i: longint; Begin s:=0; For i:=1 to a div 2 do If a mod i = 0 then s:=s+i; If s=a then exit(true); exit(false); End;
Begin Clrscr; Write('Nhap n: '); Readln(n); For i:=1 to n do If HH(i) then Write(i:5); Readln End.