F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

View Compilation Error

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


Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-06-16 16:21:58, Gzip enabled