|
|
back to boardAccepted Posted by Delpher 19 Apr 2011 19:47 program Project1319; {$APPTYPE CONSOLE} uses SysUtils; var a : array [0 .. 100, 0 .. 100] of integer; i, j, n, k, x, key : integer; begin readln(n); k := 2; x := 1; key := 2*n; //***************************************************************** repeat for I := 1 to n do begin for J := 1 to n do begin if I+J = k then begin a[i, j] := x; inc(x) end; end; end; inc(k) until k > key; //***************************************************************** for i := 1 to n do begin for j := n downto 1 do write(a[i, j]:5); writeln end; end. |
|
|