#include
using namespace std;
void get_odd_even_divisors(int n, int &odd, int &even){
odd = 0;
even = 0;
for (int i=1; i<=n; i++)<br> if (n % i == 0){
if (i % 2 == 1) odd++;
else even++;
}
}
int main() {
int n, k1, k2;
cin >> n;
get_odd_even_divisors(n, k1, k2);
cout << "odd = " << k1 << " even = " << k2;<br> return 0;
}
Пример:
24
odd = 2 even = 6