-
-
#include
#include
#define SIZE 100
int n, m, p, count;
int a[SIZE][SIZE];
void colour(int x, int y) {
count++;
a[x][y] = 1;
if ((x > 1) && (a[x - 1][y] == 0))
colour(x - 1, y);
if ((y > 1) && (a[x][y - 1] == 0))
colour(x, y - 1);
if ((x < n) && (a[x + 1][y] == 0))
colour(x + 1, y);
if ((y < m) && (a[x][y + 1] == 0))
colour(x, y + 1);
}
int main( ) {
int i, j, x, y, ans;
memset(a, 0, sizeof(a));
scanf("%d%d%d", &n, &m, &p);
...
阅读题目
填空题
经典指数
-
-
-
-
-
-
-
-
扫描后移动端查看
相关标签
同类标签
|
微信公众号
|
|
欢迎加入,一起群聊
|