Thứ Ba, 31 tháng 5, 2022

taoxdx c++


#include <bits/stdc++.h>
using namespace std;
int d[300];

int main()
{
    freopen("a.inp","r",stdin);
    freopen("a.out","w",stdout);
    string s;
    cin >> s;
    for(int i=0;i<s.size();i++) d[s[i]]++;
    int res = 0;
    for(int c='a';c<='z';c++)
        if(d[c]%2==1) res++;
    if(res>0) cout << (res-1);
    else cout<<res;
    return 0;
}

Không có nhận xét nào:

Đăng nhận xét

Lưu ý: Chỉ thành viên của blog này mới được đăng nhận xét.