矩阵转换/\坐标位置变化

After the 32nd ACM/ICPC regional contest, Wiskey is beginning to prepare for CET-6. He has an English words table and read it every morning.

One day, Wiskey’s chum wants to play a joke on him. He rolling the table, and tell Wiskey how many time he rotated. Rotate 90 degrees clockwise or count-clockwise each time.

The table has n*n grids. Your task is tell Wiskey the final status of the table.

Input
Each line will contain two number.

The first is postive integer n (0 < n <= 10).

The seconed is signed 32-bit integer m.

if m is postive, it represent rotate clockwise m times, else it represent rotate count-clockwise -m times.

Following n lines. Every line contain n characters.

Output
Output the nn grids of the final status.
在第32届ACM/ICPC地区赛结束后,威斯基开始准备大学英语六级考试。他有一张英语单词表,每天早上都看。
有一天,维斯基的朋友想跟他开个玩笑。他滚动桌子,告诉维斯基他旋转了多少次。每次顺时针旋转90度或顺时针计数。
这个表有n
n个网格。您的任务是告诉Wiskey表的最终状态。
每行包含两个数字。
第一个是正整数n(0<n<=10)。
seconed是有符号的32位整数m。
如果m为正,则表示顺时针旋转m次,否则表示顺时针旋转计数m次。
跟随n行。每行包含n个字符。
输出最终状态的n*n个网格。

Sample Input
3 2
123
456
789
3 -1
123
456
789
Sample Output
987
654
321
369
258
147

代码
//挺有意思的一道题
矩阵转换/\坐标位置变化
矩阵转换/\坐标位置变化