提交记录 #296
提交时间:2024-11-19 21:35:14
语言:c
状态:CompileError
编译情况:编译错误
code.c: In function ‘main’:
code.c:7:12: warning: implicit declaration of function ‘scanf’ [-Wimplicit-function-declaration]
7 | while (scanf("%d %d", &n, &m) == 2) {
| ^~~~~
code.c:7:12: warning: incompatible implicit declaration of built-in function ‘scanf’
code.c:1:1: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’
+++ |+#include <stdio.h>
1 |
code.c:10:18: error: ‘MAX_N’ undeclared (first use in this function)
10 | char map[MAX_N][MAX_M];
| ^~~~~
code.c:10:18: note: each undeclared identifier is reported only once for each function it appears in
code.c:10:25: error: ‘MAX_M’ undeclared (first use in this function)
10 | char map[MAX_N][MAX_M];
| ^~~~~
code.c:17:9: warning: implicit declaration of function ‘processMap’ [-Wimplicit-function-declaration]
17 | processMap(n, m, map, result);
| ^~~~~~~~~~
code.c:20:13: warning: implicit declaration of function ‘printf’ [-Wimplicit-function-declaration]
20 | printf("\n");
| ^~~~~~
code.c:20:13: warning: incompatible implicit declaration of built-in function ‘printf’
code.c:20:13: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’
code.c:22:9: warning: implicit declaration of function ‘printMap’ [-Wimplicit-function-declaration]
22 | printMap(n, m, map, result, fieldNumber);
| ^~~~~~~~
code.c:11:13: warning: unused variable ‘result’ [-Wunused-variable]
11 | int result[MAX_N][MAX_M] = {0};
| ^~~~~~
code.c:10:14: warning: unused variable ‘map’ [-Wunused-variable]
10 | char map[MAX_N][MAX_M];
| ^~~
固定测试点暂不可用
附加测试点暂不可用
40【游戏】扫雷:如此传统的游戏,你现在就可以动手来开发
int main() {
int n, m;
int fieldNumber = 0;
int firstMap = 1;
while (scanf("%d %d", &n, &m) == 2) {
if (n == 0 && m == 0) break;
char map[MAX_N][MAX_M];
int result[MAX_N][MAX_M] = {0};
for (int i = 0; i < n; i++) {
scanf("%s", map[i]);
}
processMap(n, m, map, result);
fieldNumber++;
if (!firstMap) {
printf("\n");
}
printMap(n, m, map, result, fieldNumber);
firstMap = 0;
}
return 0;
}