#include<stdio.h> #include<string.h> void count(char c,char *s); int main() { char c,s[30]; scanf("%c%s",&c,s); count(c,s); return 0; } void count(char c,char *s) { int len=strlen(s); int i,n=0; for(i=0;i<len;i++) if(c==s[i]) n++; printf("%c in %s has appear %d times.",c,s,n); }