返回列表 發帖
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. string str;
  4. int main()
  5. {
  6.     while(cin>>str)
  7.     {
  8.         int sum[26]= {0};
  9.         for(int i=0; i<str.length(); i++)
  10.         {
  11.             char c=str[i];
  12.             if(c>='A' && c<='Z')
  13.             {
  14.                 c+=32;
  15.                 str[i]=c;
  16.             }
  17.         }
  18.         for(int i=0; i<str.length(); i++)
  19.         {
  20.             char c=str[i];
  21.             if(c>='a' && c<='z')
  22.             {
  23.                 sum[c-'a']++;
  24.             }
  25.         }
  26.         int cnt=0;
  27.         for(int i=0; i<26; i++)
  28.         {
  29.             if(sum[i]%2!=0)
  30.                 cnt++;
  31.         }
  32.         if(cnt>1)
  33.             cout<<"no..."<<endl;
  34.         else
  35.             cout<<"yes !"<<endl;
  36.     }
  37.     return 0;
  38. }
複製代碼

TOP

返回列表