Compile Error

foo.cc: In function 'int main()':
foo.cc:12:13: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
   12 |     a[x][y]="*";
      |             ^~~
      |             |
      |             const char*
foo.cc:17:17: warning: comparison with string literal results in unspecified behavior [-Waddress]
   17 |     if(a[i][j]!="*")
      |                 ^~~
foo.cc:17:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
foo.cc:19:23: warning: comparison with string literal results in unspecified behavior [-Waddress]
   19 |       if(a[i-1][j-1]=="*")s++;
      |                       ^~~
foo.cc:19:23: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
foo.cc:19:27: error: 's' was not declared in this scope
   19 |       if(a[i-1][j-1]=="*")s++;
      |                           ^
foo.cc:20:21: warning: comparison with string literal results in unspecified behavior [-Waddress]
   20 |       if(a[i-1][j]=="*")s++;
      |                     ^~~
foo.cc:20:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
foo.cc:20:25: error: 's' was not declared in this scope
   20 |       if(a[i-1][j]=="*")s++;
      |                         ^
foo.cc:21:23: warning: comparison with string literal results in unspecified behavior [-Waddress]
   21 |       if(a[i-1][j+1]=="*")s++;
      |                       ^~~
foo.cc:21:23: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
foo.cc:21:27: error: 's' was not declared in this scope
   21 |       if(a[i-1][j+1]=="*")s++;
      |                           ^
foo.cc:22:21: warning: comparison with string literal results in unspecified behavior [-Waddress]
   22 |       if(a[i][j-1]=="*")s++;
      |                     ^~~
foo.cc:22:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
foo.cc:22:25: error: 's' was not declared in this scope
   22 |       if(a[i][j-1]=="*")s++;
      |                         ^
foo.cc:23:21: warning: comparison with string literal results in unspecified behavior [-Waddress]
   23 |       if(a[i][j+1]=="*")s++;
      |                     ^~~
foo.cc:23:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
foo.cc:23:25: error: 's' was not declared in this scope
   23 |       if(a[i][j+1]=="*")s++;
      |                         ^
foo.cc:24:23: warning: comparison with string literal results in unspecified behavior [-Waddress]
   24 |       if(a[i+1][j-1]=="*")s++;
      |                       ^~~
foo.cc:24:23: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
foo.cc:24:27: error: 's' was not declared in this scope
   24 |       if(a[i+1][j-1]=="*")s++;
      |                           ^
foo.cc:25:21: warning: comparison with string literal results in unspecified behavior [-Waddress]
   25 |       if(a[i+1][j]=="*")s++;
      |                     ^~~
foo.cc:25:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
foo.cc:25:25: error: 's' was not declared in this scope
   25 |       if(a[i+1][j]=="*")s++;
      |                         ^
foo.cc:26:23: warning: comparison with string literal results in unspecified behavior [-Waddress]
   26 |       if(a[i+1][j+1]=="*")s++;
      |                       ^~~
foo.cc:26:23: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
foo.cc:26:27: error: 's' was not declared in this scope
   26 |       if(a[i+1][j+1]=="*")s++;
      |                           ^
foo.cc:27:12: error: 's' was not declared in this scope
   27 |    a[i][j]=s+"0";
      |            ^
正在同步测试数据,请稍后
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P1145 扫雷
语言
C++
递交时间
2021-12-08 13:37:58
评测时间
2021-12-08 13:37:58
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes