#28054: CPP


11030067@mail.hpsh.tp.edu.tw (和平110級鄧雨珊)

學校 : 臺北市立和平高級中學
編號 : 163096
來源 : [61.64.210.174]
最後登入時間 :
2022-10-23 16:54:59
a224. 明明愛明明 | From: [219.85.43.159] | 發表日期 : 2021-11-11 23:42

#include <iostream>
using namespace std;

int main(){
ios::sync_with_stdio(0);
cin.tie(0);
string s;
while (cin >> s){
int a[26]={0};
int len=s.length();
for (int i=0; i<len; i++){
if (isalpha(s[i])){
s[i]=toupper(s[i]);
a[s[i]-'A']++;
}
}
int odd=0;
bool p=true;
for (int i=0; i<26; i++){
if (a[i]%2){
odd++;
}
if (odd>1){
p=false;
break;
}
}
if (p){
cout <<"yes !"<<endl;
}
else {
cout <<"no..."<<endl;
}
}
}
 
ZeroJudge Forum