uses crt;
var a:array[1..100]of integer;
dem,n,spt,i,t,t1:integer;
begin
clrscr;
dem:=0;
repeat
write('Nhap n='); readln(n);
dem:=dem+1;
a[dem]:=n;
until n=0;
spt:=dem-1;
writeln('Cac so ban vua nhap la: ');
for i:=1 to spt do
write(a[i]:4);
writeln;
t:=0;
for i:=1 to spt do
t:=t+a[i];
t1:=0;
for i:=1 to t-1 do
if t mod i=0 then t1:=t1+i;
if t1=t then writeln('Tong cac so ban vua nhap la so hoan toan')
else writeln('Tong cac so ban vua nhap khong la so hoan toan');
readln;
end.