Cod sursa(job #1185735)
Utilizator | Data | 16 mai 2014 17:38:23 | |
---|---|---|---|
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 char;
f:text;
begin
assign(f,'ciur.in'); reset(f);
read(f,x); close(f);
n:=0;
for i:=2 to x do
if p[i]=0 then
begin
inc(nr);
for j:=i+i to x do
p[j]:=1;
assign(f,'ciur.out');rewrite(f);
write(f,nr);
close(f);
end.