fork download
  1. #include <stdio.h>
  2.  
  3. int str_count(char *str, int c);
  4.  
  5. int main(void){
  6.  
  7. char a[10];
  8. char b;
  9.  
  10. scanf("%c",&b);
  11.  
  12. for(int i=0;i<10;i++){
  13.  
  14. scanf("%*c%c",&a[i]);
  15.  
  16. printf("%c",a[i]);
  17. }
  18.  
  19. printf("%c",b);
  20.  
  21. printf("%d",str_count(a,b));
  22.  
  23. return 0;
  24. }
  25.  
  26. int str_count(char *str, int c){
  27.  
  28. int b=0;
  29.  
  30. for(int i=0;i<10;i++){
  31.  
  32. if(str[i]==c){
  33.  
  34. b++;
  35. }
  36. }
  37.  
  38. return b;
  39. }
Success #stdin #stdout 0s 5460KB
stdin
Standard input is empty
stdout
 ���V0