文章
79
粉丝
221
获赞
46
访问
202.2k
#include <iostream>
#include <string>
using namespace std;
int main() {
string s1, s2;
while (getline(cin, s1)&&getline(cin, s2)) {
if(s1=="#")
break;
for (int i = 0; i < s1.size(); i++) {
int sum = 0;
for (int j = 0; j < s2.size(); j++)
if (s2[j] == s1[i])
sum++;
cout << s1[i] << " " << sum << endl;
}
}
return 0;
}
登录后发布评论
暂无评论,来抢沙发