Cod sursa(job #1185737)
Utilizator | Data | 16 mai 2014 17:40:05 | |
---|---|---|---|
Problema | Ciurul lui Eratosthenes | Scor | 0 |
Compilator | fpc | Status | done |
Runda | Arhiva educationala | Marime | 0.29 kb |
var n,x,k:longint;
i,j:longint;
a:array[1..10000]of byte;
f:text;
begin
assign(f,'ciur.in'); reset(f);
read(f,x); close(f);
n:=0;
for i:=2 to x do
if a[i]=0 then
begin
inc(n);
for j:=i+i to x do
a[j]:=1;
end;
assign(f,'ciur.out');rewrite(f);
write(f,n);
close(f);
end.