Advertisement
CLazStudio

q199026408

Mar 15th, 2017
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.32 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int n, b, k, s = 0;
  8.     cin >> n >> b >> k;
  9.  
  10.     while (n > 0)
  11.     {
  12.         if (n % 10 == b) s++;
  13.         n /= 10;
  14.     }
  15.  
  16.     if (k == s)
  17.         cout << k << endl;
  18.     else
  19.         cout << ((s > k) ? "YES" : "NO") << endl;
  20.  
  21.     return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement