Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6. int n, m, d, c = 0;
  7. scanf("%d", &n);
  8. scanf("%d", &m);
  9.  
  10. while(n > 0)
  11. {
  12. if (n % 10 == m)
  13. c++;
  14. n = n/ 10;
  15.  
  16. }
  17. printf("%d", c);
  18.  
  19.  
  20.  
  21.  
  22. return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement