#P399. 【例69.2】 矩阵交换行
【例69.2】 矩阵交换行
Description
Given a matrix (mathematically, an matrix is a rectangular array of elements arranged in rows and columns), swap the -th row with the -th row and output the result.
Input Format
The input consists of lines. The first lines contain the elements of each row of the matrix (each element is an integer between and ), with elements separated by a single space.
The -th line contains two integers and , separated by a space ().
Output Format
Output the matrix after swapping the rows. Each row of the matrix should be on a separate line, with elements separated by a single space.
Sample
1 2 2 1 2
5 6 7 8 3
9 3 0 5 3
7 2 1 4 6
3 0 8 2 4
1 53 0 8 2 4
5 6 7 8 3
9 3 0 5 3
7 2 1 4 6
1 2 2 1 2