program Sohoanthien; uses crt; var n,i,t:integer; BEGIN clrscr;t:=0; Write(‘Nhap so nguyen duong N: ‘);readln(n); for i:=1 to n do if n mod i =0 then t:=t+i; if t/n=2 then writeln(‘La so hoan thien’) else writeln(‘Khong la so hoan thien’); readln END.
program hoanthien;
uses crt;
var n,t,i:integer;
begin
clrscr;
write(‘Nhap so: ‘)
readln(n);
t:=0;
for i:=1 to n div 2 do
if n mod i=0 then t:=t+i;
if t=n then write(n,’ la so hoan thien’)
else write(n’ khong la so hoan thien’);
readln
end.
program Sohoanthien;
uses crt;
var n,i,t:integer;
BEGIN
clrscr;t:=0;
Write(‘Nhap so nguyen duong N: ‘);readln(n);
for i:=1 to n do
if n mod i =0 then t:=t+i;
if t/n=2 then writeln(‘La so hoan thien’) else writeln(‘Khong la so hoan thien’);
readln
END.