第22719题 单选题
下列用于计算整数位数的C++代码存在bug,相关描述正确的是?

下面C++代码拟用于计算整数N的位数,比如对 123 则输出 123是3位整数,但代码中可能存在bug。下列有关描述正确的是( )。

int N, N0, rc=0;
cout << "请输入整数: ";
cin >> N;

N0 = N;
while (N){
    rc++;
    N /= 10;
}

printf("%d是%d位整数\n", N, rc); // L11
{{ option.label }}
子题{{ index + 1 }} {{ child.type_label }}
{{ option.label }}
✓ 正确 ◐ 部分正确 ✗ 错误
程序运行统计
暂无判题统计
提交{{ questionInfo.stats ? questionInfo.stats.submit_count : 0 }}次 正确率{{ statsAccuracy }}%
答案解析