#include<iostream>
using namespace std;
int main() {
setlocale(0, "");
int nech=0, ch=0;
int a;
cin >> a;
while(a!=0){
if (a % 2 == 0)ch++;
else nech++;
}
cout <<"НЕЧЕТНЫХ "<< ch <<" ЧЕТНЫХ "<< nech << endl;
system("pause");
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
#include<iostream>
using namespace std;
int main() {
setlocale(0, "");
int nech=0, ch=0;
int a;
cin >> a;
while(a!=0){
cin >> a;
if (a % 2 == 0)ch++;
else nech++;
}
cout <<"НЕЧЕТНЫХ "<< ch <<" ЧЕТНЫХ "<< nech << endl;
system("pause");
}