foo.cpp:1:1: error: 'include' does not name a type
include <stdio.h>
^
foo.cpp: In function 'bool judge1(int*, int)':
foo.cpp:4:83: warning: unused variable 'i' [-Wunused-variable]
const int INF=1<<30; bool judge1(int l[MAXN+1],int n){ bool flag=true; int t; int i; if(n==0){ return true; } if(n%2==0){ flag=false; } t=n/2; if(l[1]<l[2]){ //左子树,右子树<根 if(flag==false){ l[n+1]=INF; } for(i=1;i<=t;i++){ if(l[i]<l[i*2]&&l[i]<l[i*2+1]){ } else{return false;} } return true; } else{ if(flag==false){ l[n+1]=-INF; } for(i=1;i<=n/2;i++){ if(l[i]>l[i2]&&l[i]>l[i2+1]){
^
foo.cpp: At global scope:
foo.cpp:8:1: error: expected unqualified-id before 'return'
return true;
^
foo.cpp:9:1: error: expected declaration before '}' token
}
^
foo.cpp: In function 'bool judge1(int*, int)':
foo.cpp:7:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^