about summary refs log tree commit diff
path: root/others/volume1/046.pas
diff options
context:
space:
mode:
authorRaphael McSinyx <vn.mcsinyx@gmail.com>2017-02-13 10:29:05 +0700
committerRaphael McSinyx <vn.mcsinyx@gmail.com>2017-02-13 10:29:05 +0700
commitac0a1ea7dabaee1b986927efb25e94a3a091fff5 (patch)
tree5765f412d59d73303c2ec981da4c4e1ef073bb99 /others/volume1/046.pas
parent36461ea5c65fcdf7169abdb39549ef53a15d4f03 (diff)
downloadcp-ac0a1ea7dabaee1b986927efb25e94a3a091fff5.tar.gz
Update others/volume1
Diffstat (limited to 'others/volume1/046.pas')
-rw-r--r--others/volume1/046.pas16
1 files changed, 16 insertions, 0 deletions
diff --git a/others/volume1/046.pas b/others/volume1/046.pas
new file mode 100644
index 0000000..146ba7a
--- /dev/null
+++ b/others/volume1/046.pas
@@ -0,0 +1,16 @@
+var
+  n, i, j: int16;
+
+begin
+  readln(n);
+  for i := 0 to n - 1 do
+    begin
+      if i mod 2 = 0 then
+        for j := 1 to n do
+          write(i * n + j, ' ')
+      else
+        for j := n downto 1 do
+          write(i * n + j, ' ');
+      writeln
+    end
+end.