Advertisement
Guest User

Untitled

a guest
Oct 18th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int cif(int&a, int b)
  6. {
  7. int c=0;
  8. while (a)
  9. {
  10. if (a%10==b)
  11. c++;
  12. a=a/10;
  13. }
  14. cout << c;
  15. }
  16.  
  17. int main()
  18. {
  19. int a,b;
  20. cin >> a >> b;
  21. cif(a,b);
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement