Pagini recente » Cod sursa (job #1608076) | Statistici popescu ioana (ioanapopescu947) | Istoria paginii runda/com2009 | Cod sursa (job #1370514) | Cod sursa (job #196489)
Cod sursa(job #196489)
program ciur;
{$APPTYPE CONSOLE}
uses
SysUtils;
var c,i,j,n,m:integer;
fin,fout:text;
v:array [1..2000000] of byte;
begin
assign(fin,'ciur.in'); reset(fin);
assign(fout,'ciur.out'); rewrite(fout);
readln(fin,n);
for i:=1 to n do v[i]:=1;
for i:=2 to n div 2 do
begin
if v[i] = 1 then
begin
j:=1;
While i * j <= n do
begin
inc(j);
v[i*j]:=0;
end;
end;
end;
c:=0;
For i:=1 to n do if v[i] = 1 then inc(c);
writeln(fout,c-1);
close(fin);
close(fout);
end.