{Tento zdrojovy kod je chranen autorskym
zakonem a bez svoleni autora nesmi byt
upravovan, dale poskytovan a ani zverejnen!}

{na tomto miste zacina chraneny obsah!!!}
uses crt;
type tmatice=array[1..20,1..20] of integer;
var z: char;
    matice,obracenamatice:tmatice;

procedure nactimatici(var matice:tmatice);
var m,n:integer;
begin
     for m:=1 to 20 do
         begin
              for n:=1 to 20 do
                  begin
                       matice[m,n]:=random(10);
                  end;
         end;
end;

procedure vypismatici(matice:tmatice);
var m,n:integer;
begin
     for m:=1 to 20 do
         begin
              for n:=1 to 20 do
                  begin
                       write(matice[m,n]:3);
                  end;
              writeln;
         end;
end;

procedure otocmatici(matice:tmatice; var obracenamatice:tmatice);
var m,n,i:integer;
begin
     for m:=1 to 20 do
         begin
              i:=1;
              for n:=20 downto 1 do
                  begin
                       obracenamatice[m,i]:=matice[m,n];
                       inc(i);
                  end;
         end;
end;

begin
repeat
clrscr;
writeln('Trtkal 2008 - http://fei.trtkal.net');
writeln('-----------------------------------');
begin
     randomize;
     nactimatici(matice);
     writeln('Puvodni matice');
     vypismatici(matice);
     writeln('Otocena matice');
     otocmatici(matice,obracenamatice);
     vypismatici(obracenamatice);
end;
writeln('-----------------------------------');
write('Opakovat a/n: ');readln(z);
until (z='n');
end.
{a zde chraneny obcas konci :D}