Pagini recente » Monitorul de evaluare | Cod sursa (job #193806) | steleinf2010 | Arhiva de probleme | Cod sursa (job #412974)
Cod sursa(job #412974)
var a:array[1..100000000] of longint;
f,g:text;
i,j,b,nr,n:longint;
x:char;
begin
assign(f,'ciur.in'); reset(f);
assign(g,'ciur.out'); rewrite(g);
{while not eoln(f) do begin
read(f,x);
s:=ord(x)-ord('0');
n:=n*p+s;
p:=10;
end;}
read(f,n);
for i:=2 to n do begin
j:=1; b:=0;
while (j<=n) and (b<=n) do begin
j:=j+1;
b:=j*i;
a[b]:=1;
end; end;
for b:=2 to n do
if a[b]=0 then nr:=nr+1;
write(g,nr);
close(g);
close(f);
end.