Pagini recente » Cod sursa (job #2710397) | Cod sursa (job #11878) | Cod sursa (job #3123185) | Cod sursa (job #1481209) | Cod sursa (job #509389)
Cod sursa(job #509389)
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:=3;
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 begin cond:=false;
break;
end;
if (cond=true) then nr:=nr+1;
x:=x+2;
end;
writeln (g,nr+1);
close (f);
close (g);
end.