第22852题 单选题
下面C++代码用于获得正整数N的第M位数,约定个位数为第1位,如N等于1234,M等于2,则输出3。假设M的值是大于等于1且小于等于N的位数。横线处应填入的代码是( )。
    int N, M, div=1;
    cout << "请输入一个正整数:";
    cin >> N;
    cout << "请输入从右到左取第几位数:";
    cin >> M;

    for (int i =0; i < (M - 1); i++) div *= 10;

    cout << (______________);
{{ option.label }}
子题{{ index + 1 }} {{ child.type_label }}
{{ option.label }}
✓ 正确 ◐ 部分正确 ✗ 错误
程序运行统计
暂无判题统计
提交{{ questionInfo.stats ? questionInfo.stats.submit_count : 0 }}次 正确率{{ statsAccuracy }}%
答案解析