пʼятницю, 18 травня 2012 р.

n простих чисел

uses crt;
Var s,n,k,i:word; p:boolean;
Begin
clrscr;
write('Vvedit N - ');
readln(k);
 n:=1; s:=0;
 repeat
   n:=n+1;
   p:=false;
   for i:=2 to n div 2 do
      if n mod i=0 then p:=true;
   if not p then
    begin
      write(n,' '); s:=s+1;
    end;
 until s=k;
 readln;
end.

1 коментар:

  1. LuckyClub Lucky Club Casino Site - Live Casino Games for Everyone
    Lucky Club Lucky luckyclub Club has over 1,000 of the hottest new slots from leading providers including NetEnt, Play'n GO, Nolimit City and many more.

    ВідповістиВидалити