Umiestnenie súboru www.TrSek.com/zadania/dokoncisla.pas
{ DOKONCISLA.PAS                                 Copyright (c) Pheo }
{ Program urèí èi èíslo je dokonalé èíslo.                          }
{                                                                   }
{ Datum:24.06.1997                             http://www.trsek.com }

program dokoncisla;
const n=100;
var i:array[1..n] of integer;
    c,a,x,y:integer;
begin
 c:=0;
 writeln('zadaj cislo od 1 do 100');
 read(a);

 for x:=1 to a-1 do
 begin
 y:=a mod x;
 if y=0 then
  begin
   i[x]:=x;
   c:=c+i[x];
   writeln(c)
  end;
 end;

 if c=a then writeln('dokonale cislo')
        else writeln('nedokonale cislo');
 readln;
end.

Copyrigth by Zdeno Sekerak 2007, http://www.trsek.com