Untitled

пкупукп
mail@pastecode.io avatar
unknown
c_cpp
a year ago
455 B
0
Indexable
Never
#include <iostream>
#include <string>
using namespace std;

int main()
{
	int N;
	cin >> N;
	int temp = N;
	int count = 0;
	int digit = 0;
	int summ = 0;
	int nechCount =0, chCount = 0;
	do {
		digit = temp % 10;

		if (digit % 2 == 0) {
			chCount += 1;
		}
		else {
			nechCount += 1;
		}

		summ += digit;

		temp /= 10;
		count++;


	} while (temp > 0);
	cout << "nechet: " << nechCount << ", chent: " << chCount;

	
}