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