about summary refs log tree commit diff
path: root/others/volume1/080.pas
diff options
context:
space:
mode:
authorRaphael McSinyx <vn.mcsinyx@gmail.com>2017-02-21 21:09:39 +0700
committerRaphael McSinyx <vn.mcsinyx@gmail.com>2017-02-21 21:09:39 +0700
commit7d19f480637e9e880b98dabfbcf8e885b0a2d3b9 (patch)
treefa52914a2e58bc13570839fa297be05b7b7616bf /others/volume1/080.pas
parentf2d4bc6b7c302dee2d84a3acf84b83b5a98c45fa (diff)
downloadcp-7d19f480637e9e880b98dabfbcf8e885b0a2d3b9.tar.gz
Update others/volume1
Diffstat (limited to 'others/volume1/080.pas')
-rw-r--r--others/volume1/080.pas17
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.