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

PROGRAMMING:Scratch the lottery

Luz5年前 (2021-05-10)题库465
"Scratch lottery" is an online game inside a small game. As shown in the figure:
![- 362960_ 55cb6a89bf693.png](~/e6f4f992-0e14-4a9f-bd2e-353c109dd196.png)
Every time a game player gets a lottery ticket, there will be nine numbers on it, from number 1 to number 9. The numbers are not repeated, and they are arranged on the lottery ticket in the form of "nine palace grid" of $$3 / times3 $.
At the beginning of the game, you can see the numbers in one position, but the numbers in other positions are not visible. You can select the number of three positions to scratch, so that the player can see the number of four positions. Finally, players can choose one of the eight directions from three horizontal, three vertical and two oblique directions. The sum of the three numbers in the direction can be cashed according to the following table to get the corresponding amount of gold coins.
|Total number | get gold | total number | get gold|
| -------- | -------- | -------- | -------- |
| 6 | 10,000 | 16 | 72 |
| 7 | 36 | 17 | 180 |
| 8 | 720 | 18 | 119 |
| 9 | 360 | 19 | 36 |
| 10 | 80 | 20 | 306 |
| 11 | 252 | 21 | 1,080 |
| 12 | 108 | 22 | 144 |
| 13 | 72 | 23 | 1,800 |
| 14 | 54 | 24 | 3,600 |
| 15 | 180 | || |
Now please write a simulation program to simulate the process of the game.
###Input format:
Input the first part to give a legal lottery ticket, that is, use 3 rows and 3 columns to give the numbers from 0 to 9** 0 means that the number in this position can be seen at the beginning * *, not that the number in the lottery is 0.
The second part gives the players three positions to scrape, which is divided into three lines. Each line gives the line number and column number of the player's scraped position according to the format 'x, y' (the position in the upper left corner is defined as the first line and the first column in the title.). The data ensures that the player will not repeatedly scratch the number that has been scratched.
The last part gives players the direction to choose, that is, an integer: 1 to 3 means to choose the first, second and third horizontal rows, 4 to 6 means the first, second and third vertical columns, 7 and 8 mean the main diagonal from top left to bottom right and the auxiliary diagonal from top right to bottom left respectively.
###Output format:
For each scrape operation, output the number that the player can see in one line. Finally, for the selected direction, output the number of gold coins in a row.
###Input example:
```in
1 2 3
4 5 6
7 8 0
1 1
2 2
2 3
seven
```
###Output example:
```out
one
five
six
one hundred and eighty
```







answer:If there is no answer, please comment