文章
211
粉丝
1
获赞
1164
访问
48.7k
#include<bits/stdc++.h>
using namespace std;
int main(){
string s1,s2;
while(getline(cin, s1)){
if(s1 == "#")
break;
getline(cin, s2);
for (char c : s1) {
int cnt = 0;
// 统计 c 在 s2 中出现的次数
for (char d : s2) {
if (c == d)
cnt++;
}
cout << c << " " << cnt << endl;
}
}
return 0;
}
登录后发布评论
暂无评论,来抢沙发