藏药炮制记录药材重量,代码如下,输出结果是? #include using namespace std; int main() { int total=0; // 定义变量 total,初始值为 0 for(int i=1; i<=3; i++) // 循环条件:i从1开始,到3结束,一共循环3次 total+=10; // 等价于 total = total + 10,每次循环加10 cout<<total; // 输出最终结果 return 0; }
A:10
B:20
C:30
D:40
正确答案:C
试卷来源:2026年智传民韵 C++编程(小学组4-6 年级)模拟卷(二)