Main.cc:1:1: error: ‘include’ does not name a type; did you mean ‘__has_include’?
include
^~~~~~~
__has_include
Main.cc: In function ‘int main()’:
Main.cc:7:1: error: ‘string’ was not declared in this scope
string Map[10]; //储存地图
^~~~~~
Main.cc:7:1: note: suggested alternative: ‘struct’
string Map[10]; //储存地图
^~~~~~
struct
Main.cc:9:3: error: ‘cin’ was not declared in this scope
cin>>Map[j]; //一次读一行
^~~
Main.cc:9:3: note: suggested alternative: ‘main’
cin>>Map[j]; //一次读一行
^~~
main
Main.cc:9:8: error: ‘Map’ was not declared in this scope
cin>>Map[j]; //一次读一行
^~~
Main.cc:12:9: error: ‘Map’ was not declared in this scope
if (Map[i][j] == 'C')
^~~
Main.cc:14:7: error: ‘X’ was not declared in this scope
X = i;
^
Main.cc:15:7: error: ‘Y’ was not declared in this scope
Y = j;
^
Main.cc:19:7: error: ‘x’ was not declared in this scope
x = i;
^
Main.cc:20:7: error: ‘y’ was not declared in this scope
y = j;
^
Main.cc:22:24: error: ‘X’ was not declared in this scope
while (count < 100 && (X!=x || Y!=y)) //一百步之内或者未找到则继续找
^
Main.cc:22:27: error: ‘x’ was not declared in this scope
while (count < 100 && (X!=x || Y!=y)) //一百步之内或者未找到则继续找
^
Main.cc:22:32: error: ‘Y’ was not declared in this scope
while (count < 100 && (X!=x || Y!=y)) //一百步之内或者未找到则继续找
^
Main.cc:22:35: error: ‘y’ was not declared in this scope
while (count < 100 && (X!=x || Y!=y)) //一百步之内或者未找到则继续找
^
Main.cc:24:25: error: ‘Map’ was not declared in this scope
if (m==0 && x-1>=0 && Map[x-1][y]!='*')//模拟老鼠的移动
^~~
Main.cc:33:6: warning: operation on ‘m’ may be undefined [-Wsequence-point]
m=(++m)%4;
~^~~~~~~~
Main.cc:34:25: error: ‘Map’ was not declared in this scope
if (c==0 && X-1>=0 && Map[X-1][Y]!='*') //模拟猫的移动
^~~
Main.cc:43:6: warning: operation on ‘c’ may be undefined [-Wsequence-point]
c=(++c)%4;
~^~~~~~~~
Main.cc:46:16: error: ‘X’ was not declared in this scope
printf("%d\n",(X == x && Y == y)?count:-1);
^
Main.cc:46:21: error: ‘x’ was not declared in this scope
printf("%d\n",(X == x && Y == y)?count:-1);
^
Main.cc:46:26: error: ‘Y’ was not declared in this scope
printf("%d\n",(X == x && Y == y)?count:-1);
^
Main.cc:46:31: error: ‘y’ was not declared in this scope
printf("%d\n",(X == x && Y == y)?count:-1);
^
Main.cc:46:1: error: ‘printf’ was not declared in this scope
printf("%d\n",(X == x && Y == y)?count:-1);
^~~~~~
Main.cc:46:1: note: suggested alternative: ‘int’
printf("%d\n",(X == x && Y == y)?count:-1);
^~~~~~
int
Main.cc: At global scope:
Main.cc:47:3: error: expected unqualified-id before ‘return’
} return 0; }
^~~~~~
Main.cc:47:13: error: expected declaration before ‘}’ token
} return 0; }
^