【单选题】【消耗次数:1】
以下程序段运行后sum的值为()。intk=0,sum=0;inta[3][4]={1,2,3,4,5,6,7,8,9,10,11,12};for(;kk++)sum+=a[k][k+1];
9
18
19
21
参考答案:
复制
纠错
相关题目
【单选题】 若有以下说明,int?a[12]={1,2,3,4,5,6,7,8,9,10,11,12};?则数值为4的表达式是()
①  a[4]
②  a(3)
③  a[3+1]
④  a[4]-a[0]
【单选题】 下面程序执行后的结果是() #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
【单选题】 有以下程序,程序执行后的输出结果是( ) #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
【单选题】 有以下程序,执行后输出结果是() 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
【单选题】 以下程序段运行后x的值为()。inta[8]={1,2,3,4,5,6,7,8},i,x=0;for(i=0;ii++,i++)x=x+a[i];
①  36
②  16
③  20
④  18
【单选题】 若有以下数组说明inta[12]={1,4,7,10,2,5,8,11,3,6,9,12};则i=10;a[a[i]]元素数值是( )。
①  10
②  9
③  6
④  5
【单选题】 有以下程序段int?a[10]={1,2,3,4,5,6,7,8,9,10},*p=&a[3],b;b=p[5];b中的值是()
①  5
②  6
③  8
④  9
【单选题】 设执行以下程序段时依次输入1、3、5,执行结果为______。 ??? Dim a(4) As Integer, b(4) As Integer ??? For K = 0 To 2 ??????? a(K + 1) = Val(InputBox(请输入数据)) ??????? b(3 - K) = a(K + 1) ??? Next K ??? Print b(K)
①  0
②  3
③  5
④  1
【单选题】 在JavaScript中,运行下面的代码,sum的值是( )。 var sum = 0; for(i = 1; i < 10; i++) { if(i%5==0) break; sum = sum + i; }
①  40
②  50
③  5
④  10
【单选题】 以下程序的运行结果是()。intfun(inta[4][4]){inti;for(i=0;ii++)printf("%2d",a[i][2]);printf("\n");}main(){inta[4][4]={1,1,2,2,1,9,0,0,2,4,0,0,0,5,9,8};fun(a);}
①  1905
②  2000
③  2008
④  2009
随机题目
【单选题】 If you don’t go to the theatre tomorrow afternoon,______.
①  nor will I
②  I neither will
③  either I will
④  I will either
【单选题】 —She may not be free today.—________, well have to put the meeting off.
①  If may
②  If not
③  If she may not
④  If she may
【单选题】 Do I need to pay a ______ when I withdraw money from other banks?
①  cash
②  money
③  fare
④  fee
【单选题】 It wasnt actually ______ expensive as you think.
①  those
②  these
③  that
④  this
【单选题】 Theresearchissodesignedthatonce______nothingcanbedonetochangeit.
①  begins
②  having begun
③  beginning
④  begun
【单选题】 Many a man______ the interest novel.
①  are read
②  is read
③  have read
④  has read
【单选题】 Borishasbrains.Infact,Idoubtwhetheranyoneintheclasshas_______IQ.
①  a high
②  a higher
③  the higher
④  the highest
【单选题】 —WhatdoyouthinkmadeMarysoupset?—______herbicycle.
①  As she lost
②  Lost
③  Losing
④  Because of losing
【单选题】 Hehasspentallhislifeworkingwithmentally______people.
①  disabled
②  discussed
③  naked
④  abolished
【单选题】 Doctors have said that as many as 50% of patients dont take medicine ______.
①  like directed
②  to be directed
③  as directed
④  so that directed