/in/foo.cc: In function 'void bfs(int, int)':
/in/foo.cc:19:31: error: 'n' was not declared in this scope
if(a[tx][ty]==0&&tx>0&&tx<=n&&ty>0&&ty<=n)
^
/in/foo.cc: In function 'int main()':
/in/foo.cc:34:17: error: 'n' was not declared in this scope
for(int i=1;i<=n;i++)
^
/in/foo.cc:41:2: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
for(int i=1;i<=10;i++)
^~~
/in/foo.cc:47:4: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'for'
cout<<k;
^~~~