-->
当前位置:首页 > 题库

PROGRAMMING:Image transformation

Luz5年前 (2021-05-10)题库395
###Task description
```
Given the gray value of each pixel in the image of M rows and N columns, the final image is obtained after a series of operations.
There are four possible operations and corresponding characters as follows:
A: Rotate 90 degrees clockwise;
B: Rotate 90 degrees counter clockwise;
C: Turn left and right;
D: Flip up and down.
```
###Input format:
```
The first line contains two positive integers m and N, which represent the number of rows and columns of the image, separated by a single space. 1 <= m <= 100, 1 <= n <= 100。
Next, m lines, n integers in each line, represent the gray value of each pixel in the image, and the adjacent two numbers are separated by a single space. Grayscale values range from 0 to 255.
The next line contains the string s composed of a, B, C, and D, indicating the sequence of operations to be performed in sequence. The length of S is between 1 and 100.
```
###Output format:
```
M 'line, each line contains n' integers, which is the gray value of each pixel in the final image. Where M 'is the number of rows of the final image and N' is the number of columns of the final image. Two adjacent integers are separated by a single space.
```
###Input example:
```in
2 3
10 0 10
100 100 10
AC
```
###Output example:
```out
10 100
0 100
10 10
```
###Title Source
This topic is selected from openjudge website http://noi.openjudge.cn/ch0112/09/







answer:If there is no answer, please comment