mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
25 lines
641 B
C++
25 lines
641 B
C++
|
#include<stdio.h>
|
||
|
#include<string.h>
|
||
|
int main()
|
||
|
{
|
||
|
int i,j,sum;
|
||
|
char a[5],b[80];
|
||
|
while(gets(a))
|
||
|
{
|
||
|
if(a[0]=='#')
|
||
|
break;
|
||
|
else
|
||
|
gets(b);
|
||
|
for(i=0;i<strlen(a);i++)
|
||
|
{
|
||
|
sum=0;
|
||
|
for(j=0;j<strlen(b);j++)
|
||
|
{
|
||
|
if(a[i]==b[j])
|
||
|
sum++;
|
||
|
}
|
||
|
printf("%c %d\n",a[i],sum);
|
||
|
}
|
||
|
}
|
||
|
}
|