program ConvertRowToString;
const
COLS = 6;
matrix: array[1..5, 1..COLS] of Integer = (
(4, 7, 9, 18, 29, 0),
(1, 9, 18, 99, 4, 3),
(9, 17, 89, 2, 7, 5),
(19, 49, 6, 1, 9, 8),
(29, 4, 7, 9, 18, 6)
);
type
TIntRow = array[1..COLS] of Integer;
TIntMatrix = array[1..5] of TIntRow;
function ConvertRowToString(var matrix: TIntMatrix; row, cols: Integer): string;
var
j: Integer;
s, numStr: string;
begin
s := '';
for j := 1 to cols do
begin
Str(matrix[row][j], numStr); { convert integer to string }
s := s + numStr + ' ';
end;
ConvertRowToString := s;
end;
var
row: Integer;
resultStr: string;
begin
row := 3; { Turbo Pascal arrays start at 1, so row 2 in C++ is row 3 here }
resultStr := ConvertRowToString(matrix, row, COLS);
WriteLn(resultStr);
end.
(*
run:
9 17 89 2 7 5
*)