图形问题求解
Problem DescriptionGiven the gray value of each transformation point of the image in n row m column. After the conversion is performed successively, please print the final image.
The possible operations and corresponding characters are as follows:
A: Rotate clockwise by 90 degrees;
B: Rotate counterclockwise by 90 degrees ;
C: Flip left and right;
D: Turn upside down.
Input
Multi testcases(<=10).
For each testcase:
two integers n, m (1 <= n,m <= 100) in the first line
m integers (0 <= a[i][j] <= 255) in next n lines
a string s (|s| <= 100) in a line, means the operations.
Output
For each testcase:
m integers in n lines meas the final image
Sample Input
2 3
10 0 10
100 100 10
AC
Sample Output
10 100
0 100
10 10