#K80297. Rotate Matrix 90 Degrees Clockwise
Rotate Matrix 90 Degrees Clockwise
Rotate Matrix 90 Degrees Clockwise
You are given an n × n matrix. Your task is to rotate the matrix by 90 degrees clockwise.
The transformation can be mathematically represented as follows: given an element at position \( (i,j)\) in the original matrix, its new location in the rotated matrix will be \( (j, n-1-i)\), where \( n \) is the dimension of the matrix.
Please implement a solution that reads the matrix from standard input and outputs the rotated matrix to standard output.
inputFormat
The first line contains an integer n, representing the dimensions of the matrix.
The following n lines each contain n space-separated integers representing the matrix rows.
outputFormat
Output the rotated matrix in the same format: n lines each containing n space-separated integers.
## sample3
1 2 3
4 5 6
7 8 9
7 4 1
8 5 2
9 6 3
</p>