第37673题 判断题
下面两段C++代码都是用于求1-10的和,其运行结果相同。通常说来,for循环都可以用while循环实现。( )
int tnt;
int i;

tnt = 0;
for (i = 1; i < 10 + 1; i++)
    tnt += i;
cout << tnt << endl;
int tnt;
int i;

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