Pagini recente » Cod sursa (job #867027) | Cod sursa (job #1127431) | Cod sursa (job #1606811) | Cod sursa (job #302995) | Cod sursa (job #509384)
Cod sursa(job #509384)
program ciur;
var x,i,n,nr:longint;
cond:boolean;
f,g:text;
begin
assign (f,'ciur.in'); reset (f);
assign (g,'ciur.out'); rewrite (g);
x:=2;
nr:=0;
read (f,n);
while (x<=n) do begin cond:=true;
for i:=2 to x div 2 do if (x mod i=0) then cond:=false;
if (cond=true) then nr:=nr+1;
x:=x+1;
end;
writeln (g,nr);
close (f);
close (g);
end.