Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program doskonala;
- uses crt;
- var
- x,i,suma,y:longint;
- begin
- clrscr;
- writeln('Program sprawdza czy liczba jest doskonala');
- write('Podaj il. liczb do spr ');
- readln(y);
- for x:=1 to y do
- begin
- suma:=1;
- i:=2;
- repeat
- if x mod i=0 then suma:=suma+1;
- i:=i+1;
- until i=x;
- if suma=x then writeln('Liczba doskonala' ,x)
- end;
- write('Skonczylem tyle ile znalazlem');
- readkey;
- end.
Add Comment
Please, Sign In to add comment