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