代码实现
#include <bits/stdc++.h>
using namespace std;
int main()
{
string s1, s2;
char c1, c2;
cin >> s1 >> c1 >> s2 >> c2;
string t1(count(s1.begin(), s1.end(), c1), c1);
string t2(count(s2.begin(), s2.end(), c2), c2);
/* 如果没有c1或者c2 */
if (t1.empty()) t1 = "0";
if (t2.empty()) t2 = "0";
cout << stoi(t1) + stoi(t2);
return 0;
}