Cod sursa(job #361116)
Utilizator | Data | 3 noiembrie 2009 19:47:20 | |
---|---|---|---|
Problema | Ciurul lui Eratosthenes | Scor | 0 |
Compilator | fpc | Status | done |
Runda | CNRV #4 | Marime | 0.29 kb |
var n,nr,i,j:longint;ok:boolean;f,g:text;
begin
assign(f,'ciur.in');reset(f);
assign(g,'ciur.out');rewrite(g);
read(f,n);nr:=0;
for i:=2 to n do begin
ok:=true;j:=2;
while ok=true do begin
if i mod j=0 then ok:=false;
inc(j);end;
if ok then inc(nr);
end;
write(g,nr);close(g);
end.