const nmax=20; var a:array[1..nmax,1..nmax] of integer; n,i,j:byte; begin repeat write('Ââåäèòå ðàçìåð ìàòðèöû îò 2 äî ',nmax,' n='); readln(n); until n in [2..nmax]; for i:=1 to n do begin for j:=1 to n do begin if odd(i) then a[i,j]:=(i-1)*n+j else a[i,j]:=(i-1)*n+n-j+1; write(a[i,j]:4); end; writeln; end; end.