#30249: string 是個好東西www


810177@stu.hgsh.hc.edu.tw (810177董蒙恩)

學校 : 不指定學校
編號 : 145795
來源 : [120.104.3.13]
最後登入時間 :
2022-02-16 11:24:31
a224. 明明愛明明 | From: [101.137.189.149] | 發表日期 : 2022-05-10 21:47

#include <bits/stdc++.h>

using namespace std;

int main(){
    string s;
    while(cin >> s){
        int a[26] = {0};
        for(int i = 0; i<s.length(); i++){
            if(64 < s[i] && s[i] < 91) a[s[i]-65]++;
            else if(96 < s[i] && s[i] < 123) a[s[i]-97]++;
        }
        int cnt = 0;
        for(int i = 0; i<26; i++) if(a[i]%2 != 0) cnt++;
        if(cnt <= 1) cout << "yes !" << endl;
        else cout << "no..." << endl;
    }

    return 0;
}

 
#31566: Re: string 是個好東西www


jason096727@gmail.com (Jason Ho)

學校 : 高雄市苓雅區福東國民小學
編號 : 189939
來源 : [150.116.71.76]
最後登入時間 :
2023-07-15 21:32:51
a224. 明明愛明明 | From: [150.116.71.227] | 發表日期 : 2022-08-07 18:06

#include

using namespace std;

int main(){
    string s;
    while(cin >> s){
        int a[26] = {0};
        for(int i = 0; i
            if(64 < s[i] && s[i] < 91) a[s[i]-65]++;
            else if(96 < s[i] && s[i] < 123) a[s[i]-97]++;
        }
        int cnt = 0;
        for(int i = 0; i<26; i++) if(a[i]%2 != 0) cnt++;
        if(cnt <= 1) cout << "yes !" << endl;
        else cout << "no..." << endl;
    }

    return 0;
}

你的作法好鬼

 
ZeroJudge Forum