#C8836. Matrix Rotation
Matrix Rotation
Matrix Rotation
Given an ( n \times n ) matrix, rotate it by ( 90^\circ ) clockwise. In other words, for every element in the matrix, its new position will be determined by transposing the matrix and then reversing the order of elements in each row. The problem requires reading the matrix from the standard input and writing the rotated matrix to the standard output.
inputFormat
The first line of the input contains a single integer ( n ), representing the size of the matrix. The next ( n ) lines each contain ( n ) space-separated integers representing the matrix elements.
outputFormat
Output the rotated matrix with ( n ) lines, each containing ( n ) space-separated integers. There should be no extra spaces at the end of the lines.## sample
1
5
5
</p>