Advertisement
edutedu

vr 3 pr4

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