Untitled
unknown
plain_text
2 years ago
293 B
9
Indexable
#include <iostream>
using namespace std;
int main()
{
int A;
cin >> A;
int count_even = 0;
int count_odd = 0;
while (A > 0) {
if ((A % 10) % 2 == 0) {
count_even += 1;
}
else count_odd += 1;
A /= 10;
}
cout << count_even << " " << count_odd;
}
Editor is loading...