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

PROGRAMMING:pictures rotating

Luz5年前 (2021-05-10)题库390
Two dimensional image is composed of pixels. At present, gray image uses an integer between 0-255 to represent the pixel value of a pixel. Program to complete the picture rotation control program.
This topic requires reading 2 integers m and n (< = 20) as the length and width of the picture. Enter an integer r as the rotation angle (only one of 90, 180 - 90 can be entered, 90 means the figure rotates 90 degrees to the left and - 90 means the figure rotates 90 degrees to the right). Then enter the pixel value of the image according to the row and column,
###Input format:
The first line: two integers m and n (< = 20) < br > are used
The second line: two integers R (only one of 90, 180 - 90, otherwise prompt: angle data error < br > 0
After the third row: enter the integer data of M rows and N columns, which must be between 0-255, otherwise, prompt: matrix data error < br > 0
All the above input data are integers. If there is non integer data input, you will be prompted: data type error < br > uniformly
###Output format:
Image matrix data rotated as required
###Input example:
Here is a set of inputs. For example:
```in
3 4
ninety
1 2 3 4
5 6 7 8
9 10 11 12
```
###Output example:
The corresponding output is given here. For example:
```out
4 8 12
3 7 11
2 6 10
1 5 9
```







answer:If there is no answer, please comment