foo.cc:4:13: error: array bound is not an integer constant before ']' token
int pre[MAXN];
^
foo.cc:6:10: error: 'x' was not declared in this scope
int find(x){
^
foo.cc:11:11: error: expected identifier before '(' token
void union(x, y){
^
foo.cc:11:13: error: expected ')' before ',' token
void union(x, y){
^
foo.cc:11:16: error: expected initializer before ')' token
void union(x, y){
^
foo.cc: In function 'int main()':
foo.cc:22:27: error: 'pre' was not declared in this scope
for (int i=0; i<n; ++i) pre[i] = i;
^~~
foo.cc:22:27: note: suggested alternative: 'drem'
for (int i=0; i<n; ++i) pre[i] = i;
^~~
drem
foo.cc:25:4: error: expected primary-expression before 'union'
union(a,b);
^~~~~
foo.cc:29:16: error: 'find' cannot be used as a function
puts( find(a) == find(b) ? "yes" : "no");
^
foo.cc:29:27: error: 'find' cannot be used as a function
puts( find(a) == find(b) ? "yes" : "no");
^
foo.cc:24:9: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d%d",&a,&b);
~~~~~^~~~~~~~~~~~~~
foo.cc:28:9: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d%d",&a,&b);
~~~~~^~~~~~~~~~~~~~
自豪的采用HydroJudge(https://github.com/hydro-dev/Hydro)进行评测。