Untitled

mail@pastecode.io avatar
unknown
c_cpp
7 months ago
304 B
0
Indexable
Never
#include <iostream>
using namespace std;

int main()
{
	int a;
	int even = 0;
	int odd = 0;
	cin >> a;

	if (a == 0) {
		even = 1;
	}
	else {
		while (a != 0) {
			if (a % 10 % 2 == 0) {
				even++;
			}
			else {
				odd++;
			}
			a /= 10;
		}
	}
	cout << even << ' ' << odd;
}