Pagini recente » Cod sursa (job #518411) | Diferente pentru problema/logic intre reviziile 6 si 89 | Diferente pentru problema/secv10 intre reviziile 5 si 4 | Cod sursa (job #1858160) | Cod sursa (job #1754394)
var a:array[1..1000000] of longint;
i,j,n,k:longint;
begin
assign(input, 'ciur.in');
reset(input);
assign(output, 'ciur.out');
rewrite(output);
readln(K);
n:=1;
a[1]:=2;
i:=3;
while i<=K do
begin
j:=1;
while (sqr(a[j])<=i) AND not (i mod a[j] = 0) do j:=j+1;
if i mod a[j]<>0
then begin
n:=n+1;
a[n]:=i;
end;
i:=i+2;
end;
writeln(N);
end.