Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int cif(int a, int b)
- {
- int ct=0;
- while(a)
- {
- if(a%10==b)
- ct++;
- a/=10;
- }
- return ct;
- }
- int main()
- {
- int a, b;
- cin>>a;
- cin>>b;
- cout<<cif(a,b);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement