From 7d19f480637e9e880b98dabfbcf8e885b0a2d3b9 Mon Sep 17 00:00:00 2001 From: Raphael McSinyx Date: Tue, 21 Feb 2017 21:09:39 +0700 Subject: Update others/volume1 --- others/volume1/080.pas | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 others/volume1/080.pas (limited to 'others/volume1/080.pas') 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. -- cgit 1.4.1