diff options
Diffstat (limited to 'others/volume1/080.pas')
-rw-r--r-- | others/volume1/080.pas | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/others/volume1/080.pas b/others/volume1/080.pas new file mode 100644 index 0000000..599511a --- /dev/null +++ b/others/volume1/080.pas @@ -0,0 +1,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. |