VAR i, j, k: Integer; a, b: Array [1..5] of Array [1..5] of Integer; BEGIN For i := 1 to 5 do For j := 1 to 5 do Read(a[i][j]);
k := 1; For i := 1 to 5 do If (Odd(i)) then For j := 5 downto 1 do begin b[i][j] := a[((k-1) div 5)+1][((k-1) mod 5)+1]; Inc(k); End Else For j := 1 to 5 do begin b[i][j] := a[((k-1) div 5)+1][((k-1) mod 5)+1]; Inc(k); End;
For i := 1 to 5 do begin For j := 1 to 5 do Write(b[i][j]:2, ' '); Writeln; End; END.
i, j, k: Integer;
a, b: Array [1..5] of Array [1..5] of Integer;
BEGIN
For i := 1 to 5 do
For j := 1 to 5 do Read(a[i][j]);
k := 1;
For i := 1 to 5 do
If (Odd(i)) then
For j := 5 downto 1 do begin
b[i][j] := a[((k-1) div 5)+1][((k-1) mod 5)+1]; Inc(k); End
Else
For j := 1 to 5 do begin
b[i][j] := a[((k-1) div 5)+1][((k-1) mod 5)+1]; Inc(k); End;
For i := 1 to 5 do begin
For j := 1 to 5 do Write(b[i][j]:2, ' ');
Writeln; End;
END.