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

PROGRAMMING:Mahjong table of little h and W

Luz5年前 (2021-05-10)题库394
On this day, Xiaohao and Xiaowen come to a friend's house to play mahjong. Xiaohao is a mahjong black hole. He loses all his money, so he stares at the mahjong table and falls into meditation.
*We can divide the table into $$W times h $$squares, and the size of each square is $$1 times 1 $.
*We define the center of the grid as its coordinates.
*Therefore, for each center point $$(x, y) $$, the actual grid range is $$X '\ in [x-0.5, x + 0.5], y' \ in [y-0.5, y + 0.5] $.
*The point $$(0,0) $$is in the center of the upper left-hand grid.
*The point $$(w-1,0) $$is in the center of the upper right-hand lattice.
*The point $$(0, h-1) $$is in the center of the lower left corner lattice.
*The point $$(W-1, h-1) $$is in the center of the lower right corner lattice.
The designer circled a circle and a square, and wanted to paste mahjong logo on these lattices. The specific requirements are as follows:
*For circle C, give its center coordinate $$(R)_ c, y_ c) $$and its radius $$R $$. If and only if the distance between the center of the lattice and the radius does not exceed $$R $, the lattice will be labeled with mahjong logo. As shown in the figure below.
*For a square, the coordinates of two vertices of one side are given in clockwise order_ 1, y_ 1),(x_ 2,y_ 2)$$。 If and only if the center of the lattice is on the edge or inside of the rectangle, the lattice will be labeled with mahjong logo. The given edge is guaranteed to be parallel to the coordinate axis. As shown in the figure below.
![ 1.png](~/5052b49e-6f22-418b-b906-67bfdc4b3c68.png)
Now I'll give you the information about the length and width of the card table, as well as the circle and rectangle. Please help to draw the whole card table. If you don't need to paste mahjong logo, please output '\', otherwise please output '/' (without quotation marks). Your output should ensure that the top left corner of the card table is the first character you output.
###Input format:
The input data consists of three lines. The first line includes two integers, $$W, H (10, W, h, 200) $$, indicating the length and width of the mahjong table. The second line contains three integers $$X_ c, y_ c. R (100) le x_ c, y_ C < Le 200,0 < R < Le 200) $$, indicating the center and radius of the circle. The third line contains four integers $$X_ 1, y_ 1, x_ 2,y_ 2(-100\le x_ 1,y_ 1,x_ 2,y_ 2) $$, which represents the two endpoints of the rectangle.
###Output format:
Output a total of $$W $$lines, each line of $$h $$characters, as' / 'or' \ '(without quotation marks).
###Input example:
Here is a set of inputs. For example:
```in
11 11
5 5 5
4 3 4 7
```
###Output example:
The corresponding output is given here. For example:
```out
\\\\\/\\\\\
\\///////\\
\/////////\
\/////////\
\/////////\
///////////
\/////////\
\/////////\
\/////////\
\\///////\\
\\\\\/\\\\\
```







answer:If there is no answer, please comment