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

PROGRAMMING:Did Gobang win( Simple judgment)

Luz5年前 (2021-05-10)题库503
Suppose that the board of Gobang is' n * n '(positive integer' n < 20 '), the sunspot is represented by' * ', the white one by' # ', and the vacancy by'< br>
Now I'll give you a chess game. Please judge whether the sunspot wins or not. If you win, show win and give the coordinates of the top chess piece in the leftmost column of the winning array( The coordinates of the upper left corner of the chessboard are '(0, 0)'and the coordinates of the lower right corner are' (n-1, n-1) '< br > all the chessboards are in the same position
If it is not won, "not yet" is displayed< br>
be careful:
** * regardless of whether the white pieces win or not and whether the number of pieces matches the sunspots, only the sunspot arrangement * * is considered.
*In order to simplify the calculation, there is no need to consider the winning or banning conditions such as "live four", "four three company", "long company" and "three three company". Only five (or more) sunspots are judged to be in a straight line, including horizontal line, vertical line or diagonal line.
*The input ensures that there is only one sunspot winning permutation at most, and there is no need to consider how to judge the leftmost position when there are multiple permutations.
###Input format:
The first line is a positive integer 'n (n < 20)', and the next line is a 'n' line of characters representing the arrangement of the chessboard. Each line has' n '*' or '#' or '.' characters.
###Output format:
If the sunspot (denoted by *) wins, print a line of characters, followed by 'win x y', where 'x','y 'is the coordinate of the top piece in the leftmost column of the sunspot winning array,' x 'is the abscissa, and' y 'is the ordinate< br>
If the sunspot does not win, print a line: ` not yet '.
###Input sample 1:
```in
six
.***..
..#...
..#...
......
....*.
.....*
```
###Output sample 1:
```out
Not yet
```
###Input sample 2:
```in
seven
..#....
..#....
..#..*.
..#.*..
..#*...
..*..##
.*.****
```
###Output sample 2:
```out
Win 1 6
```







answer:If there is no answer, please comment