#C569. Rotate Matrix 90 Degrees Clockwise
Rotate Matrix 90 Degrees Clockwise
Rotate Matrix 90 Degrees Clockwise
You are given a square matrix of size \( n \times n \). Your task is to rotate the matrix by 90 degrees clockwise. The relation between the original matrix \( M \) and the rotated matrix \( R \) is given by:
\( R_{j, n-1-i} = M_{i,j} \)
You must read the matrix from standard input and output the rotated matrix to standard output.
inputFormat
The first line contains an integer \( n \), the size of the matrix. The following \( n \) lines each contain \( n \) space-separated integers representing the matrix rows.
outputFormat
Output the rotated matrix. Each of the \( n \) lines should contain \( n \) space-separated integers representing the rotated matrix rows.
## sample3
1 2 3
4 5 6
7 8 9
7 4 1
8 5 2
9 6 3
</p>