hdoj1860

来源:互联网 发布:ubuntu安装ibus 编辑:程序博客网 时间:2024/05/29 16:00

#include <stdio.h>
#include <string.h>
 
int main(int argc, char* argv[])
{
 char small[6];
 char big[81];
 char *pbhead,*pb,*ps;
 int c;
 gets(small);

 while(strcmp(small,"#") != 0)
 {
  gets(big);

  ps = small;
  pbhead = pb = big;
  
  while(*ps != '/0')
  {
   for(pb = pbhead,c=0; *pb != '/0';pb++)
    if(*ps == *pb)
     c++;
   printf("%c %d/n",*ps,c);
   
   ps++;
  }
  gets(small);
 }


 return 0;
}