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_19224922_14172.cpp: In function 'int getp(int, int, bool)':
0_0_19224922_14172.cpp:12:59: error: 'a' was not declared in this scope
 int result = p;    for(int i = s; i <= t; i++){        if(a[i] == 'A')            flag  = true;        result += gnum(a[i]);    }    if(result <= 11 && flag)        result += 10;    return result;}int getd(int s, 
                                                           ^
0_0_19224922_14172.cpp:12:119: error: 'a' was not declared in this scope
 int result = p;    for(int i = s; i <= t; i++){        if(a[i] == 'A')            flag  = true;        result += gnum(a[i]);    }    if(result <= 11 && flag)        result += 10;    return result;}int getd(int s, 
                                                                                                                       ^
0_0_19224922_14172.cpp:12:123: error: 'gnum' was not declared in this scope
 int result = p;    for(int i = s; i <= t; i++){        if(a[i] == 'A')            flag  = true;        result += gnum(a[i]);    }    if(result <= 11 && flag)        result += 10;    return result;}int getd(int s, 
                                                                                                                           ^
0_0_19224922_14172.cpp: In function 'int getd(int, int, bool)':
0_0_19224922_14172.cpp:14:204: error: 'a' was not declared in this scope
 int result = d;    if(result >= 17)        return result;    if(flag && result <= 11 && result + 10 >= 17)        return result + 10;    for(int i = s; i <= t; i++)        if(result < 17){            if(a[i] == 'A')                flag = true;            result += gnum(a[i]);            if(flag && result <= 11 &result + 10 >= 17)                return result + 10;        }        else             return result;        return result;}
                                                                                                                                                                                                            ^
0_0_19224922_14172.cpp:14:271: error: 'a' was not declared in this scope
 int result = d;    if(result >= 17)        return result;    if(flag && result <= 11 && result + 10 >= 17)        return result + 10;    for(int i = s; i <= t; i++)        if(result < 17){            if(a[i] == 'A')                flag = true;            result += gnum(a[i]);            if(flag && result <= 11 &result + 10 >= 17)                return result + 10;        }        else             return result;        return result;}
                                                                                                                                                                                                                                                                               ^
0_0_19224922_14172.cpp:14:275: error: 'gnum' was not declared in this scope
 int result = d;    if(result >= 17)        return result;    if(flag && result <= 11 && result + 10 >= 17)        return result + 10;    for(int i = s; i <= t; i++)        if(result < 17){            if(a[i] == 'A')                flag = true;            result += gnum(a[i]);            if(flag && result <= 11 &result + 10 >= 17)                return result + 10;        }        else             return result;        return result;}
                                                                                                                                                                                                                                                                                   ^
0_0_19224922_14172.cpp: In function 'int main()':
0_0_19224922_14172.cpp:15:40: error: 'a' was not declared in this scope
 int main(){    while(1){        memset(a, 0, sizeof(a));        fgets(a, 1000, stdin);        flagp = false;        flagd = false;        ans = false;        if(a[strlen(a) - 1] == '\n')            a[strlen(a) - 1] = '\0';        len = strlen(a);        if(strcmp(a, einput) == 0)            break;        p = gnum(a[0]) + gnum(a[2]);        d = gnum(a[1]) + gnum(a[3]);        if(a[0] == 'A')            flagp = true;        if(a[2] == 'A')            flagp = true;        if(a[1] == 'A')            flagd = true;        if(a[3] == 'A')            flagd = true;        if(len == 4){            if(flagp && p <= 11)                p += 10;            if(flagd && d <= 11)                d += 10;            if(p>=d)                printf("Yes\n");            else                printf("No\n");         }        else{            sum = p;            ans = false;            tp = p;            if(flagp && tp <= 11)                tp += 10;            td = getd(4, len-1, flagd);            if(tp <= 21)                if(tp >= td || td > 21)                {                    ans = true;                }            for(int i = 4; i <= len - 1; i++){                if(ans)                    break;                sum += gnum(a[i]);                if(sum > 21)                    break;                tp = getp(4, i , flagp);                td = getd(i + 1, len -1, flagd);                if(tp <= 21)                    if(tp >= td || td > 21){                        ans = true;                        break;                    }             }            if(ans)                printf("Yes\n");            else                printf("No\n");         }     }    return 0;}
                                        ^
0_0_19224922_14172.cpp:15:268: error: 'einput' was not declared in this scope
 int main(){    while(1){        memset(a, 0, sizeof(a));        fgets(a, 1000, stdin);        flagp = false;        flagd = false;        ans = false;        if(a[strlen(a) - 1] == '\n')            a[strlen(a) - 1] = '\0';        len = strlen(a);        if(strcmp(a, einput) == 0)            break;        p = gnum(a[0]) + gnum(a[2]);        d = gnum(a[1]) + gnum(a[3]);        if(a[0] == 'A')            flagp = true;        if(a[2] == 'A')            flagp = true;        if(a[1] == 'A')            flagd = true;        if(a[3] == 'A')            flagd = true;        if(len == 4){            if(flagp && p <= 11)                p += 10;            if(flagd && d <= 11)                d += 10;            if(p>=d)                printf("Yes\n");            else                printf("No\n");         }        else{            sum = p;            ans = false;            tp = p;            if(flagp && tp <= 11)                tp += 10;            td = getd(4, len-1, flagd);            if(tp <= 21)                if(tp >= td || td > 21)                {                    ans = true;                }            for(int i = 4; i <= len - 1; i++){                if(ans)                    break;                sum += gnum(a[i]);                if(sum > 21)                    break;                tp = getp(4, i , flagp);                td = getd(i + 1, len -1, flagd);                if(tp <= 21)                    if(tp >= td || td > 21){                        ans = true;                        break;                    }             }            if(ans)                printf("Yes\n");            else                printf("No\n");         }     }    return 0;}
                                                                                                                                                                                                                                                                            ^
0_0_19224922_14172.cpp:15:320: error: 'gnum' was not declared in this scope
 int main(){    while(1){        memset(a, 0, sizeof(a));        fgets(a, 1000, stdin);        flagp = false;        flagd = false;        ans = false;        if(a[strlen(a) - 1] == '\n')            a[strlen(a) - 1] = '\0';        len = strlen(a);        if(strcmp(a, einput) == 0)            break;        p = gnum(a[0]) + gnum(a[2]);        d = gnum(a[1]) + gnum(a[3]);        if(a[0] == 'A')            flagp = true;        if(a[2] == 'A')            flagp = true;        if(a[1] == 'A')            flagd = true;        if(a[3] == 'A')            flagd = true;        if(len == 4){            if(flagp && p <= 11)                p += 10;            if(flagd && d <= 11)                d += 10;            if(p>=d)                printf("Yes\n");            else                printf("No\n");         }        else{            sum = p;            ans = false;            tp = p;            if(flagp && tp <= 11)                tp += 10;            td = getd(4, len-1, flagd);            if(tp <= 21)                if(tp >= td || td > 21)                {                    ans = true;                }            for(int i = 4; i <= len - 1; i++){                if(ans)                    break;                sum += gnum(a[i]);                if(sum > 21)                    break;                tp = getp(4, i , flagp);                td = getd(i + 1, len -1, flagd);                if(tp <= 21)                    if(tp >= td || td > 21){                        ans = true;                        break;                    }             }            if(ans)                printf("Yes\n");            else                printf("No\n");         }     }    return 0;}
                                                                                                                                                                                                                                                                                                                                ^


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-11-26 19:48:42, Gzip enabled