Pagini recente » Cod sursa (job #1774382) | Cod sursa (job #1787215) | Cod sursa (job #3230288) | Cod sursa (job #1521287) | Cod sursa (job #514312)
Cod sursa(job #514312)
program numere_prime;
var i,nr,j,n:longint;
cond:boolean;
f,g:text;
begin
assign (f,'ciur.in'); reset (f);
assign (g,'ciur.out'); rewrite (g);
read (f,n);
i:=3;
nr:=1;
while (i<=n) do begin cond:=true;
for j:=2 to i div 2 do if (i mod j=0) then begin cond:=false;
break;
end;
if (cond=true) then nr:=nr+1;
i:=i+1;
end;
write (g,nr);
close (f);
close (g);
readln;
end.