#2308. 练习 单选2
练习 单选2
输入2468,下面程序输出是()。
int n;
cin >> n;
int cnt = 0;
while (n != 0) {
if (n % 10 % 2 == 1) cnt++;
n /= 10;
}
cout << cnt;
{{ select(1) }}
- 0
- 1
- 2
- 4
输入2468,下面程序输出是()。
int n;
cin >> n;
int cnt = 0;
while (n != 0) {
if (n % 10 % 2 == 1) cnt++;
n /= 10;
}
cout << cnt;
{{ select(1) }}