#38850: cpp


blocker_nagnto (淵空)

學校 : 臺北市立大安高級工業職業學校
編號 : 252870
來源 : [210.70.131.241]
最後登入時間 :
2024-01-04 10:11:01
a224. 明明愛明明 | From: [210.70.131.241] | 發表日期 : 2023-12-28 09:12

#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