#include<iostream>
#include<string>
using namespace std;
int main()
{
char a[6],b[82];
int x,y;
while(gets(a)){
int c[82]={0};
if(!strcmp(a,"#")) break;//或者if(a[0]=='#')break;开始我就犯了超低级的错误写成if(a=='#')a是数组啦~~
x=strlen(a);
gets(b);
y=strlen(b);
for(int i=0;i<y;i++)
for(int j=0;j<x;j++){
if(b[i]==a[j])
c[j]++;
}
for(int j=0;j<x;j++)
cout<<a[j]<<' '<<c[j]<<endl;
}
// system("pause");
return 0;
}
hud 1860 简单字符串处理
最新推荐文章于 2022-02-25 19:38:17 发布