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