Problem Statement
Write a program to rotate a square matrix 90 degrees clockwise.
DEMO-C-32 โข Programming in C
Write a program to rotate a square matrix 90 degrees clockwise.
Input: Dimensions N M followed by the matrix elements.
Output: The formatted result as specified.
Submit runs every public testcase in this browser. Results and code never leave this device.
4 3 2 16 28 20 27 17 17 28 29 21 -5 21
21 17 20 2 -5 28 27 16 21 29 17 28
3 3 -4 18 21 11 34 23 22 12 21
22 11 -4 12 34 18 21 23 21
2 2 16 1 31 -3
31 16 -3 1
5 4 16 7 36 37 20 -3 26 48 29 49 46 7 28 26 14 43 19 29 49 43
19 28 29 20 16 29 26 49 -3 7 49 14 46 26 36 43 43 7 48 37
C, C++, Java, and Python run locally in a browser VM. No worker or visualizer is used.
/workspace/question