# define row 22
# define col 22
Int saolei [row] [col], wanjia [row] [col];//hide array and to display an array of player
Void dayin (int d [row] [col], int n, int m)//print the array
{int I=0, j=0; Printf (" ");//in order to print the array around the tip aligned coordinate digital printf (" \ n "); For (I=1; I & lt; N + 1; {i++) for (j=1; J & lt; M + 1; J++) {printf (" % d ", d [I] [j]); } printf (" \ n "); } printf (" \ n ");
}
Int count (int c [row] [col], int n, int m) {//9 mean matrix in 9 representative ray
int count=0;
If (c [n] [m]==9) count=9.
The else {
If (c [n - 1]] [m - 1==9) count++;
If (c [n]] [m - 1==9) count++;
If (c/n + 1] [m - 1==9) count++;
If (c [n - 1) [m]==9) count++;
If (c [n + 1] [m]==9) count++;
If (c [n - 1] [m + 1)==9) count++;
If (c [n] [m + 1)==9) count++;
If (c [n + 1] [m + 1)==9) count++;
}
return count;
}
Void open (int n, m int, int x, int y)//surrounding the coordinate function
{if ((x> 0) & amp; & (x
{wanjia [1] x [1] y=count (saolei, 1 x, y - 1); }//show the coordinates ray number around the if (wanjia [1] x [1] y==0) {open (n, m, x - 1, y - 1); } the if (wanjia [1] x [y]==1)
{wanjia [1] x [y]=count (saolei, 1 x, y); }//show the coordinates ray number around the if (wanjia [1] x [y]==0) open (n, m, 1 x, y); If (wanjia [1] x [y + 1)==1)
[y] {wanjia [x - 1 + 1)=count (saolei, 1 x, y + 1); }//show the coordinates ray number around the if (wanjia [1] x [y + 1)==0) open (n, m, x - 1, y + 1); If (wanjia [x] [1] y==1)
{wanjia [x] [1] y=count (saolei, x, y - 1); }//show the coordinates ray number around the if (wanjia [x] [1] y==0) open (n, m, x, y, 1); If (wanjia [x] [y + 1)==1)
{wanjia [x] [y + 1]=count (saolei, x, y + 1); }//show the coordinates ray number around the if (wanjia [x] [y + 1)==0) open (n, m, x, y + 1); If (wanjia [x + 1] [1] y==1)
{wanjia [x + 1] [1] y=count (saolei, x + 1, y - 1); }//show the coordinates ray number around the if (wanjia [x + 1] [1] y==0) open (n, m, x + 1, y - 1); If (wanjia [x + 1] [y]==1)
{wanjia [x + 1] [y]=count (saolei, x + 1, y);//show the coordinates around ray number
}
If (wanjia [x + 1] [y]==0) open (n, m, x + 1, y);
If (wanjia [x + 1] [y + 1)==1)
{wanjia [x + 1] [y + 1)=count (saolei, x + 1, + y
CodePudding user response:
Your post code, is there any relationship and executionThis part of the post code, also it has performed to quit, what's the use of that stick the code? !