about summary refs log tree commit diff
path: root/others/volume1/080.pas
blob: 599511a32962db5e6a03afc5b5523e9e78c124c0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
var
  n, i, j: int32;
  b: array of boolean;

begin
  readln(n);
  setlength(b, n + 1);
  for i := 2 to n do
    b[i] := true;
  for i := 2 to trunc(sqrt(n)) do
    if b[i] then
      for j := 2 to n div i do
        b[i * j] := false;
  for i := 2 to n do
    if b[i] then
      writeln(i)
end.