Untitled
unknown
c_cpp
2 years ago
388 B
7
Indexable
#include <iostream>
using namespace std;
int main()
{
int a;
cin >> a;
int sum = a;
int d = 0;
int g = 0;
int sumon = 0;
int nechet = 0,chet = 0;
do {
g = d % 10;
if (g % 2 == 0) {
chet += 1;
}
else {
nechet += 1;
}
sumon += g;
sum /= 10;
d++;
} while (sum > 0);
cout <<"nechet" << nechet << ' ' << "chet" << chet;
}Editor is loading...