vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:23:1: error: expected '}' before 'else'
else x2=k;
^~~~
vision.cpp:20:3: warning: suggest explicit braces to avoid ambiguous 'else' [-Wdangling-else]
if(i==1)
^
vision.cpp:25:1: error: expected ';' before '}' token
}
^
vision.cpp:12:13: warning: unused variable 'y' [-Wunused-variable]
int ind=0,x,y,x2,y2;
^
vision.cpp:12:18: warning: unused variable 'y2' [-Wunused-variable]
int ind=0,x,y,x2,y2;
^~
vision.cpp: At global scope:
vision.cpp:28:1: error: expected unqualified-id before 'if'
if(ind==1)
^~
vision.cpp:30:5: error: 'ind' does not name a type; did you mean 'int'?
ind=0;
^~~
int
vision.cpp:31:1: error: expected unqualified-id before 'for'
for(int k=1;k<=W;k++){
^~~
vision.cpp:31:13: error: 'k' does not name a type
for(int k=1;k<=W;k++){
^
vision.cpp:31:18: error: 'k' does not name a type
for(int k=1;k<=W;k++){
^
vision.cpp:46:1: error: expected unqualified-id before 'if'
if(ind==1)
^~
vision.cpp:48:13: error: 'x' was not declared in this scope
int p=abs(x-x1)+abs(y-y1);
^
vision.cpp:48:15: error: 'x1' was not declared in this scope
int p=abs(x-x1)+abs(y-y1);
^~
vision.cpp:48:15: note: suggested alternative: 'y1'
int p=abs(x-x1)+abs(y-y1);
^~
y1
vision.cpp:48:23: error: 'y' was not declared in this scope
int p=abs(x-x1)+abs(y-y1);
^
vision.cpp:49:3: error: expected unqualified-id before 'if'
if(p==k){
^~
vision.cpp:54:1: error: expected declaration before '}' token
}
^