about summary refs log tree commit diff
path: root/others/volume1/046.pas
blob: 146ba7a96b8e6ebb7613d0a0ca00159bb64fee89 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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.