#21565: WA(line:18) 大神求救!! "共輸出17行"


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

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

#include <stdio.h>

int main(void){

    int  eof,i,k,a[26],check,sum;
    char c[1001];

    while(scanf("%d",&eof)!=EOF){
        scanf("%s",c);
        for(i=0;i<26;i++)
        {
            a[i]=0;
        }
        i=0;
        sum=0;
        while(c[i]!='\0'){

            if(c[i]>=65&&c[i]<=90)
                c[i]+=32;

            if(c[i]>=97&&c[i]<=122)
            {
                a[c[i]-97]++;
                sum++;
            }
            else
            {
            }
            i++;
        }   
        check=0;
        for(i=0;i<26;i++)
        {
            if(a[i]%2==1)
                check++;
        }
        if(check>1&&sum>2)
        {
            printf("no...\n");
        }
        else
        {
            printf("yes !\n");
        }
    }
}
 
ZeroJudge Forum