Chủ Nhật, 3 tháng 4, 2022

XAUHH C++



#include <bits/stdc++.h>
using namespace std;

int d[200],e[200];
string a,b;

int main()
{
    freopen("xauhh.inp","r",stdin);
    freopen("xauhh.out","w",stdout);
    getline(cin,a);
    getline(cin,b);
    for(int i=0;i<=a.length()-1;i++)
    {
        d[a[i]]++;
    }
    for(int i=0;i<=b.length()-1;i++)
    {
        e[b[i]]++;
    }
    int res=0;
    for(int i='a';i<='z';i++)
    {
        if(d[i]>0&&e[i]==0) res=res+d[i];
        if(d[i]==0&&e[i]>0) res=res+e[i];
    }
    cout<<res;
}

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.