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_23161615_2680.cpp: In function 'int main()':
0_0_23161615_2680.cpp:21:756: error: expected '}' at end of input
     case '(' :        return 0;        break;    default :        return -1;    }}int main(){    int i,j,k,n,t,top,p;    scanf("%d",&n);   char s11[10000];   int g=0;    while(gets(s11))    {        ++g;        int f=0,k=0;        char s[150];        char s2[1000+10],s3[1000+10],s1[10000];        int s4[10010];        memset(s4,0,sizeof(s4));        t=strlen(s11);        int j=-1,top=0,p1=0;        for(int i=0;i<t;i++)        {            if(s11[i]=='F')            {                s1[p1++]='0';            }            if(s11[i]=='V')            {                s1[p1++]='1';            }            if(s11[i]=='|'||s11[i]=='!'||s11[i]=='&'||s11[i]=='('||s11[i]==')')                s1[p1++]=s11[i];            else                continue;        }        //cout<<s1;        for(i=0; i<p1; i++)        {            if(s1[i]=='0'||s1[i]=='1')            {                s3[++j]=s1[i];            }            else if(s1[i]=='(')            {                s3[++j]=' ';                s2[++top]=s1[i];            }            else if(s1[i]==')')            {                while(s2[top]!='(')                {                    s3[++j]=' ';                    s3[++j]=s2[top];                    --top;                }                s3[++j]=' ';                --top;            }            else if(s1[i]=='!'||s1[i]=='|'||s1[i]=='&')            {                if(s1[i]=='!')//Õâ¸ö£¡µ¥¶Àд                {                    s2[++top]=s1[i];                }                else                {                while(we(s1[i])<=we(s2[top]))                {                    s3[++j]=' ';                    s3[++j]=s2[top];                    --top;                }                s3[++j]=' ';                s2[++top]=s1[i];                }            }        }        while(top>=1)        {            s3[++j]=' ';            s3[++j]=s2[top];            --top;            if(s2[1]=='(')                break;        }        s3[++j]=' ';        //s3[++j]='\0';//        for(int i=0;i<j;i++)//        {//            if(s3[i]!=' ')//                printf("%c",s3[i]);//        }        int p=0;        k=0;        for(int i=0; i<j; i++)        {            if(s3[i]=='1'||s3[i]=='0')            {                s4[p++]=s3[i]-'0';            }            else if(s3[i]==' ') continue;            else if(s3[i]=='!'||s3[i]=='&'||s3[i]=='|')            {                int ni,ha;                p=p-1;                ni=s4[p];                if(s3[i]=='&')                {                    ha=s4[--p];                    s4[p++]=(ni&ha);                }                if(s3[i]=='|')                {ha=s4[--p];                    s4[p++]=(ni|ha);                }                if(s3[i]=='!')                {                s4[p++]=(!ni);                }            }        }        printf("Expression %d: ",g);        if(s4[p-1]==0)        {            printf("F\n");        }        else            printf("V\n");    }    return 0;}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    ^
0_0_23161615_2680.cpp:21:756: error: expected '}' at end of input


Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2025 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.001000(s) query 1, Server time : 2025-02-17 05:16:02, Gzip enabled