【单选题】【消耗次数:1】
下面程序执行后的结果是() #include stdio.h void fun( ) { int i,sum=0; int a[5]={1,2,3,4,5}; for (i=0;i { if (a[i]%2==0) { sum+=a[i]; } } printf(%d,sum); } void main( ) { fun( ); }
6
15
9
11
参考答案:
复制
纠错
➡️如需代学继续教育,联系微信:yizhituziang

相关题目
【单选题】 有以下程序,程序执行后的输出结果是( ) #include int fun(int x [ ],int n) { static int sum=0,i; for(i=0; i{ sum+=x[i]; } return sum; } void main( ) { int a[ ]={1,2,3,4,5}; int b[ ]={6,7,8,9},s=0; s=fun(a,5)+fun(b,4); printf(%d\n,s); }
①  45
②  50
③  60
④  66
【简答题】 以下程序输出结果是[填空1]。#include stdio.hvoid main(){ int i, sum=0;for(i=1; i i++)sum+=i;printf(″%d\n″,sum);}
【简答题】 以下程序输出结果是[填空1]。#include stdio.hvoid main(){ int i, sum=0;for(i=1; i i++)sum+=i;printf(″%d\n″,sum);}
【简答题】 以下程序输出结果是[填空1]。#include stdio.hvoid main(){ int i, sum=0;for(i=1; i i++)sum+=i;printf(″%d\n″,sum);}
【单选题】 有如下程序 main() { int i,sum=2; for(i=1;ii+=2) sum+=i; printf(“%d\n”,sum); } 该程序的执行结果是( )
①  6
②  3
③  死循环
④  4
【单选题】 有以下程序,程序运行以后的输出结果是() #include stdio.h main( ) { int a[ ]={2,3,5,4},i; for(i=0;i switch(i%2) { case 0:switch(a[i]%2) {case 0:a[i]++;break; case 1:a[i]--; }break; case 1:a[i]=0; } for(i=0;i printf(\n); }
①  3 3 4 4
②  2 0 5 0
③  3 0 4 0
④  0 3 0 4
【单选题】 以下程序执行后sum的值是( )。 main() { int i,sum; for(i=1;ii++) sum+=i; printf(%d\n,sum); }
①  15
②  14
③  不确定
④  0
【单选题】 下面程序执行后的结果是() #include stdio.h int m=0; void fun( ) { m++; } void main( ) { m++; fun( ); m++; printf(%d,m); }
①  0
②  1
③  2
④  3
【单选题】 有以下程序,执行后输出结果是() main( ) { int m[][3]={1,4,7,2,5,8,3,6,9}; int i,j,k=2; for(i=0;i { printf(%d ,m[k][i]); } }
①  4 5 6
②  2 5 8
③  3 6 9
④  7 8 9
【单选题】 若定义数组并初始化,运行的结果是() void main( ) { int i,j,a[2][3]={{1,2,3},{4,5,6}}; for(i=0;i for(j=0;j printf(%d,a[i][j]); }
①  1,2,3,4,5,6
②  12345
③  123456
④  无法运行
随机题目
【判断题】 答题说明:句子没有语法错误请选择“正确”,有语法错误请选择“错误”The workers are building a flower bed in the garden.
①  正确
②  错误
【判断题】 This is too heavy for you. Let me give you a hand.划线部分应该翻译成“帮你一下”
①  正确
②  错误
【判断题】 答题说明:句子没有语法错误请选择“正确”,有语法错误请选择“错误”When the car reached the end of the assembly line, it was complete assembled
①  正确
②  错误
【判断题】 答题说明:句子没有语法错误请选择“正确”,有语法错误请选择“错误”Thats the reason because I did it.
①  正确
②  错误
【判断题】 Mr. Li came across an old friend yesterday. They were both surprised.划线部分应该翻译成“登门拜访”
①  正确
②  错误
【判断题】 答题说明:句子没有语法错误请选择“正确”,有语法错误请选择“错误”Ford proposed a system in that each worker would have a special job to do.
①  正确
②  错误
【判断题】 答题说明:句子没有语法错误请选择“正确”,有语法错误请选择“错误”Only his father drives the new car on Sundays.
①  正确
②  错误
【多选题】 Tom_____________ a letter from his mother yesterday.
①  got
②  accepted
③  bought
④  received
【多选题】 Youd better_____________ that tyre now.
①  change
②  replace
③  cheat
④  repeat
【多选题】 These seats are_____________ for old and sick people.
①  seen
②  driven
③  kept
④  reserved