#2302. 例题2

例题2

下面程序输入12345 后,输出是()。

int n;
cin >> n;
int cnt = 0;
while (n != 0) {
    if (n % 10 % 2 == 1) cnt++;
    n /= 10;
}
cout << cnt;

{{ select(1) }}

  • 2
  • 3
  • 5
  • 1