【单选题】【消耗次数:1】
下列程序段的循环结构执行后,i的输出值是_______。 Dim y as Integer For i = 1 To 10 Step 2 y = y + i Next i Print i
25
10
11
因为y初值不知道,所以不确定
参考答案:
复制
纠错
相关题目
【单选题】 下面的程序段中,循环体执行的次数是( )。 Dim I,s For I=1 to 10 Step 2 s=s+I Next I
①  1
②  10
③  0
④  5
【单选题】 下面的程序段中,循环体执行的次数是( )。 Dim I,s For I=1 to 10 s=s+I Next I
①  1
②  10
③  0
④  11
【简答题】 有如下程序段: For i=1 To 3 For j=5 To 1 Step -1 Print i*j Next j Next i 程序运行后,语句print i*j的执行次数为[填空]。
【简答题】 下列程序段的运行结果是[填空] 。 Private Sub Form_Click() Dim a(3) As Long a(0) = 1: a(1) = 2: a(2) = 3: a(3) = 4 j = 1 For i = 3 To 0 Step -1 s = s + a(i) * j j = j * 10 Next i Print s End Sub
【简答题】 已知函数 。下面是实现计算该函数的程序,请填空完成以下程序。 Private Sub Command1_Click() Dim k As Integer, i As Integer, s As Long n = 5 : k = 1 For i = 1 To n s = s +[填空] Next i Print s End Sub Function pow(a As Integer, b As Integer) As Long Dim i As Integer, t As Long t = 1 For i = 1 To a [填空] Next i pow = t End Function
【单选题】 下面循环语句执行结束后输出的i值为( )。 for(int i=0;in/2){cout<<i<<endl;break;}
①  n/2
②  n/2+1
③  n/2-1
④  n-1
【单选题】 设有如下程序: Option Base 0 Private Sub Form_Click() ??? Dim a ??? Dim i As Integer ??? a = Array(1, 2, 3, 4, 5, 6, 7, 8, 9) ??? For i = 0 To 3 ??????? Print a(5 - i); ??? Next End Sub 程序运行后,单击窗体,则在窗体上显示的是?
①  6?5?4 3
②  5?4?3?2
③  4?3?2 1
④  7?6?5?4
【单选题】 下面循环语句执行结束后输出的i值为( )。 for(int i=0;in/2){coutiendl;break;}
①  n/2
②  n/2+1
③  n/2-1
④  n-1
【单选题】 下列程序段执行后的结果是( )。 String s = new String(abcdefg); for (int i=0; i<s.length(); i+=2){ System.out.print(s.charAt(i)); }
①  aceg
②  ACEG
③  abcdefg
④  abcd
【单选题】 执行以下程序段后、变量a,b,c的值分别是一。intx=10,y=9;inta,b,c;a=--x==y++)?--x:++y;b=x++;c=y;
①  a=9,b=9,c=9
②  a=8,b=8,c=10
③  a=9,b=10,c=90)a=1,b=11,c=10
随机题目
【单选题】 Could you help me with my homework, please?
①  No, no way
②  No, I couldn’t
③  No, I can’t
④  Sorry I can’t. I have to go to a meeting right now
【单选题】 Determined to __________ as if everything were normal, he responded with a kind of indifference.
①  carry on
②  account for
③  bring up
④  get through
【单选题】 Mary, your dress is really beautiful. How is John?
①  Thank you very much
②  No, no, John is not bad
③  Thank you. He is fine
④  Don’t say that. It’s ugly. John is good
【单选题】 Excuse me, sir. Where is Dr. Brown’s office?
①  You can’t ask me
②  Pardon? I have no idea
③  Please don’t say so
④  Sorry I don’t know, but you can ask the man over there
【单选题】 a reading lamp on the table.
①  There is
②  There has
③  It is
④  It has
【单选题】 And what we got to __________ is a disgrace.
①  come up with
②  catch up with
③  put up with
④  keep up with
【单选题】 In no circumstance __________ .
①  smoking should be allowed on the campus
②  should smoking be allowed on the campus
③  should smoking allowed on the campus
④  should smoking allow on the campus
【单选题】 Do you mind if I join you?
①  I’m very happy to do so
②  Never mind
③  Please do
④  Oh, I can’t
【单选题】 Hi, Sam, I think you did a good jo@@
①  Thank you
②  Don’t mention it
③  Not at all
④  I did it quite badly
【单选题】 We are interested in the weather because it __________ us so directly --- what we wear, what we do, and even how we feel.
①  benefits
②  affects
③  guides
④  effects