#21412: WA(line:18) 大神求救!!


ken12300326@gmail.com (不爽來咬我啊.)

學校 : 國立文華高級中學
編號 : 119442
來源 : [140.113.138.122]
最後登入時間 :
2021-09-25 21:35:53
a224. 明明愛明明 | From: [110.26.126.103] | 發表日期 : 2020-05-30 18:36

#include <stdio.h>

 

int main(void){

 

    char c[1001];

    int i,k[26],check,sum,t;

 

    while(scanf("%d",&i)!=EOF)

    {

        check=0;

        sum=0;

        for(i=0;i<26;i++)

        {

            k[i]=0;

        }

 

        scanf("%s",c);

        for(i=0;c[i]!='\0';i++)

        {

            switch (c[i])

            {

            case 'A':

            case 'a':

                k[0]++;

                break;

            case 'B':

            case 'b':

                k[1]++;

                break;

            case 'C':

            case 'c':

                k[2]++;

                break;

            case 'D':

            case 'd':

                k[3]++;

                break;

            case 'E':

            case 'e':

                k[4]++;

                break;

            case 'F':

            case 'f':

                k[5]++;

                break;

            case 'G':

            case 'g':

                k[6]++;

                break;

            case 'H':

            case 'h':

                k[7]++;

                break;

            case 'I':

            case 'i':

                k[8]++;

            case 'J':

            case 'j':

                k[9]++;

                break;

            case 'K':

            case 'k':

                k[10]++;

                break;

            case 'L':

            case 'l':

                k[11]++;

                break;

            case 'M':

            case 'm':

                k[12]++;

                break;

            case 'N':

            case 'n':

                k[13]++;

                break;

            case 'O':

            case 'o':

                k[14]++;

                break;

            case 'P':

            case 'p':

                k[15]++;

                break;

            case 'Q':

            case 'q':

                k[16]++;

                break;

            case 'R':

            case 'r':

                k[17]++;

                break;

            case 'S':

            case 's':

                k[18]++;

                break;

            case 'T':

            case 't':

                k[19]++;

                break;

            case 'U':

            case 'u':

                k[20]++;

                break;

            case 'V':

            case 'v':

                k[21]++;

                break;

            case 'W':

            case 'w':

                k[22]++;

                break;

            case 'X':

            case 'x':

                k[23]++;

                break;

            case 'Y':

            case 'y':

                k[24]++;

                break;

            case 'Z':

            case 'z':

                k[25]++;

            default:

                break;

            }

        }

        for(i=0;i<26;i++)

            { 

                sum+=k[i];

               if(k[i]%2==1)

                check++;

            }

 

            if(check>1&&sum>2)

            {

                printf("no...\n");

            }

            else

            {

                printf("yes !\n");

            }

    }

}

 
ZeroJudge Forum