![](https://lstatic.shangxueba.com/jiandati/h5/images/m_q_title.png)
有如下程序: #include main() { int a[5]={1,2,3,4,5},b[5]={0,2,1,3,0),i,s=0; for(i=0;i<5;i++)s=s+aEb[i]; printf(“%d\n”,s); } 程序运行后的输出结果是()。
A.6
B.10
C.11
D.15
A.6
B.10
C.11
D.15
#inculde
Main()
{ int a[5]={1,2,3,4,5},B[5]={0,2,1,3,0},I,s=0;
For(i=0;1<5;i++)s=s+a[B[i]];
printF(“%d\n”,s);
}
程序运行后的输出结果是
A.6
B.10
C.11
D.15
A. 1,4
B. 0,4
C. 1,6
D. 0,6
B、1 2 3 5 6 4
C、1 4 3 5 2 6
D、2 5 6 7 8 4
B、110
C、161
D、221
B、9 5 1
C、9 6 3
D、9 8 7
B、0,1
C、9,2
D、2,9
1: #include <stdio.h> 2: int main() 3:{ 4: int a=2; 5: int b=6.5 6: for(i=0;i <b;i++) 7: int c="a+sqrt(b);" 8: return 0; 9:} 上述程序在vc2010下的编译结果如下:> ------ Build started: Project: rrrr, Configuration: Debug Win32 ------ > main.cpp > main.cpp(6): warning C4244: 'initializing' : conversion from 'double' to 'int', possible loss of data > main.cpp(6): error C2143: syntax error : missing ';' before 'for' > main.cpp(6): error C2065: 'i' : undeclared identifier > main.cpp(6): error C2065: 'i' : undeclared identifier > main.cpp(6): error C2065: 'i' : undeclared identifier > main.cpp(7): error C3861: 'sqrt': identifier not found > main.cpp(8): error C2146: syntax error : missing ';' before identifier '; ' > main.cpp(8): error C2065: '; ' : undeclared identifier > main.cpp(8): error C2143: syntax error : missing ';' before '}' ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== 引起编译错误的原因是:
A、第五行缺少封号
B、第六行缺少封号
C、第七行有非法字符
D、第七行sqrt缺少头文件
E、第五行变量赋值类型不匹配
A.6
B.10
C.11
D.15
A、[3, 6, 9]
B、[0, 3, 6, 9]
C、[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
D、n
为了保护您的账号安全,请在“简答题”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!