Code Render Status : Rendered By HDOJ C Code Render Version 0.01 Beta
1 #include <stdio.h> 2 #include <string.h> 3 char f[6],c[81]; 4 int main() 5 { 6 int l1,i,j,sum; 7 while (gets(f)&&strcmp(f,"#")!=0) 8 { 9 gets(c); 10 l1=strlen(c); 11 j=0; 12 while (f[j]!='\0') 13 { 14 sum=0; 15 for (i=0;i<l1;i++) 16 { 17 if(f[j]==c[i]) sum++; 18 } 19 printf("%c %d\n",f[j],sum); 20 j++; 21 } 22 } 23 return 0; 24 }
本文转自ZH奶酪博客园博客,原文链接:http://www.cnblogs.com/CheeseZH/archive/2012/05/13/2498535.html,如需转载请自行联系原作者