第19219题 单选题
统计正整数中奇数数位个数的C++代码,第8行横线处应填入的代码是()

小明想要快速知道任给一个正整数中有多少个奇数位(数位值是奇数),下面的C++代码是其实现:

1 int N;
2 cin >> N;
3
4 int odd_count = 0; // 记录奇数的个数
5 int old_number = N; // 保存原数
6
7 while (N != 0){
8  if (_________________)
9   odd_count += 1;
10
11  N = (N - N % 10) / 10;
12 }
13 cout << old_number << "中共有 " << odd_count << " 个奇数";
{{ option.label }}
子题{{ index + 1 }} {{ child.type_label }}
{{ option.label }}
✓ 正确 ◐ 部分正确 ✗ 错误
程序运行统计
暂无判题统计
提交{{ questionInfo.stats ? questionInfo.stats.submit_count : 0 }}次 正确率{{ statsAccuracy }}%
答案解析