0_0_23260369_32231.cpp: In function 'int main()':
0_0_23260369_32231.cpp:177:33: error: expected statement at end of input
while((c=getchar())!='(') //????????? ; save[cnt++]=c; //??????????????? tempcnt++; while(tempcnt) //???????????? { while((c=getchar())==' '||c=='\n') //????§Þ??????? ; if(c=='(') //????????????? tempcnt++; else if(c==')') tempcnt--; save[cnt++]=c; } save[cnt++]='\0'; if(save[0]=='('&&save[1]==')') //?????????????????????????no,wa??¨¹??? { printf("no\n"); continue; } stack<int>mystack; //????????????? int cur,num=0; sscanf(&save[1],"%d",&cur); //??????????????????? num++; //?????????? mystack.push(num); tree[num].value=cur; //???§Ö?? int len=1; while(!mystack.empty()) { for(;;len++) //??????????????? if(save[len]=='('||save[len]==')') break; if(save[len]=='('&&save[len+1]!=')') //??????????? { sscanf(&save[++len],"%d",&cur); ++num; mystack.push(num); //??????????????? tree[num].value=cur; } else if(save[len]==')'&&save[len-1]!='(') //???????????????? { int temp1,temp2; temp1=mystack.top(); mystack.pop(); if(!mystack.empty()) //????????????§Ø???? { www.2cto.com temp2=mystack.top(); if(tree[temp2].haveleft==0) //???????????????????????? { tree[temp2].left=temp1; tree[temp2].haveleft=1; } else //??????????????????????? tree[temp2].right=temp1; } } len++; } flag=0; DFS(1,0); //dfs?????? if(flag==1) printf("yes\n"); else printf("no\n"); } return 0; }
^
0_0_23260369_32231.cpp:177:33: error: expected '}' at end of input
0_0_23260369_32231.cpp:177:33: error: expected '}' at end of input
|