首页/ 题库 / [单选题]以下程序的输出结果是( )。 Optio的答案

以下程序的输出结果是( )。 Option Base 1 Private Sub Command1_Click() Dim a(10),p(3) as Integer k=5 For I-1 to 10 a(i)=I Next I For j=1 to3 p(i)=a(I*j) Next j For I=l to 3 k=k+ p (I)*2 Next I Print k End Sub

单选题
2022-02-21 16:56
A、33
B、28
C、35
D、37
查看答案

正确答案
A

试题解析
解析:此题中共定义了两个数组:a(0,p(0,共用到了3次For循环。第1个For语句对数组a(i)赋值,a(1)…a(10)=1...10:第2个For语句,对p(1):1,p(2):4,p(3):9;第3个For语句,计算k的值,3次循环分别得到:5,15, 33。答案为A。

标签:
感兴趣题目
下列程序运行时输出的结果是( )。 Option Base 1 Private Sub Form_Click() Dimx(10)As Integer,y(5) As Integer ForI=1 to 10 x(i)=10-I+1 NextI ForI=1 to 5 y(i)cx(2*-1)+x(2*I) NextI ForI=1 to 5 Printy(i); NextI
下列程序运行时输出的结果是( )。 Option Base 1 Const a=10 Private Sub Form_Click() Dim x(a)As Integer k=-1 For i=1 To a x(i)=i*k k=(-1)*k Next i For i=1 To 10 Print x(i) Next i End Sub
以下程序的输出结果是( )。 Option Base 1 Private Sub Command1_Click() Dim a(10),p(3) as Integer k=5 For I-1 to 10 a(i)=I Next I For j=1 to3 p(i)=a(I*j) Next j For I=l to 3 k=k+ p (I)*2 Next I Print k End Sub
下列代码运行后输出结果是( )。 Defstr C-F Private Sub Command1_Click() C$="123" D="456" Print C+D$ End Sub
下列代码运行后输出结果是 Defstr B-E Private Sub Command1_Click() B$="123" C="456" Print B+C$ End Sub
有以下程序: Option Base 1 Dim arr()As Integer Private Sub Form. Click() Dim i As Integer,j As Integer ReDim arr(3,2) For i=1 To 3 For j=1 To 2 arr(i,j)=i*2+j Next j Next i ReDim Preserve arr(3,4) For j=3 To 4 arr(3,j)=j+9 Next j Print arr(3,2);arr(3,4) End Sub 程序运行后,单击窗体,输出结果为______。
阅读程序: Option Base 1 Private Sub Form_Click( ) Dim arr,Sum Sum=0 arr=Array(1,3,5,7,9,11,13,15,17,19) For i=1 To 10 If arr(i)/3=arr(i)3 Then Sum=Sum+arr(i) End If Next i Print Sum End Sub程序运行后,单击窗体,输出结果为
有如下程序: Option Base 1 Private Sub Form Click() Dim arr,Sum Sum =0 arr=Array(1,3,5,7,9,11,13,15,17,19) For i=1 To 10 If arr(i)/3=arr(i)3 Then Sum=Sum+arr(i) End If Next i Print Sum End Sub 程序运行后,单击窗体,输出结果为
运行以下程序后,输出的图形是 Private Sub Command1_Click( ) Line(500,500)-(1000,500) Line(750,300)-(750,700) End Sub
运行以下程序后,输出的图形是 Private Sub Command1_Click() Line(500,500)-(1000,500) Line(750,300)-(750,700) End Sub
下列程序的运行结果是 ______。Private Sub Command1_ Click () a =1: b=1 for i = 1 To 3 a= a+ b: b=b+ a Next i Print a, bEnd Sub
执行下面的程序,输出的结果是 ______ 。 Private Sub Command1_Click() ch $ = "Welcome to China!" n = Len(ch $ ) For i =1 To n-1 s$ =Mid(ch$ ,i,1) If s$ ="o" Then m=m + 1 Next i Print m End Sub
相关题目
在窗体上画一个命令按钮(其Name属性为Command1),然后编写如下代码: Option Base 1 Private Sub Command1_Click() Dim a s = 0 a = Array (1,2,3,4) j = 1 For i = 4 To 1 Step - 1 s = s + a (i) * j j = j * 10 Next i Print s End Sub 运行上面的程序,单击命令按钮,其输出结果是______
在代码窗口中,有如下事件过程,以下叙述正确的是______。Private Sub Option1_Click(Index As Integer)……End Sub
阅读程序: Option Base 1 Private Sub Form_Click() Dim art,Sum Sum=0 art=Array(1,3,5,7,9,11,13,15,17,19) For i=1 To 10 If arr(i)/3=arr(i)3 Then Sum=Sum+art(i) End If Next i Pdnt Sum End Sub 程序运行后,单击窗体,输出结果为( )。
有如下程序: Option Base 1 Private Sub Form_Click() Dim arr, Sum Sum=0 arr=Array(1, 3, 5, 7, 9, 11, 13, 15, 17, 19) For i=1 To 10 If arE(i)/3=arr(i)3 Then Sum=Sum+arr(i) End If Next i Print Sum End Sub 程序运行后,单击窗体,输出结果为______。
阅读程序: Option Base 1 Private Sub Form_Click() Dim arr, Sum Sum=0 art=Array(1, 3, 5, 7, 9, 11, 13, 15, 17, 19) For i=1 To 10 If arr(i)/3=arr(i)3 Then Sum=Sum+arr(i) End If Next i Print Sum End Sub 程序运行后,单击窗体,输出结果为______。
下面程序运行后的输出结果是 Private Sub Command1_Click() For j=1 To 10 If j Mod 3<>0 Then a=a+j3 Next Print a End Sub
编写如下程序: Private Sub Form_Click() a$="54321":b$="abcde" For j=1 To 5 Print Mid$(a$,6-j,1)+Mid$(b$,j,1); Next j Print End Sub 程序运行后,单击窗体,其输出结果为 ______。
以下程序运行后输出的结果是______。 Private Sub Form. _Click() a=0 For j=1 To 15 a=a+j Mod 3 Next j Print a End Sub
下面程序的输出是______。Private Sub Command1_Click() Print 73End Sub
在窗体上画一个命令按钮,然后写出如下事件过程: Private Sub Command1 _ Click( ) S=1 Do S=(S + 1) ^(S + 2) Number=Number+1 Loop Until S>=6 Print Number,S End Sub 程序运行后,输出的结果是
以下程序的输出结果是D)9 12 Option Base 1 Private Sub Command1_Click() Dim s(10),p(3)As Integer k=5 For i=1 To 10 a(i)=i Next i For i=1 To 3 p(i)=a(i*i) Next I For i=1 To 3 k=k+ p(i)*2 Next i Print k End sub
以下程序运行后,消息框的输出结果是( )。 OPTION BASE 1 PRIVATE SUB COMMAND1_CLICK( ) DIM A(10) , P(3) AS INTEGER K=5 FOR I=1 TO 10 A(I) = I NEXT I FOR I=1 TO 3 P(I)=A(I*I) NEXT I FOR I=1 TO 3 K=K+P (I) ~ 2 NEXT I MSGBOX K END SUB
下列程序运行时输出的结果是 Option Base 1 Private Sub Form_Click() Dim x(10) As Integer,y(5) As Integer For i=1 to 10 x(i)=10-i+1 Next For i=1 to 5 y(i)=x(2*i-1)+x(2*i) Next For i=1 to 5 Print y(i) Next End Sub
下列程序运行时输出的结果是 Option Base 1 Private Sub Form_Click() Dim x (10)As Integer,y(5)As Integer For i=1 to 10 x(i)=10-i+1 Next For i=1 to 5 y(i)=x(2*i-1)+x(2*i) Next For i=1 to 5 Print y(i) Next End Sub
下面程序:________Option Base 1Private Sub Command1_Click() Dim a(10),p(3)As Integer Dim i,k As Integer k=5 For i=1 To 10 a(i)=i Next For i=1 To 3 p(i)=a(i*i) Next For i=1 To 3 k=k+p(i)*2 Next Print kEnd Sub运行后的输出结果为________。
以下程序的输出结果是( )。 Option Base 1 Private Sub Command1 Click() Dim a(10),p(3)as Integer k=5 For I=1 to 10 a(i)=I Next I For j=1 to 3 p(i)=a(I*j) Next j For I=1 to 3 k=k+p(I)*2 Next I Print k End Sub
有如下程序,运行时输出的结果是 ______。 Option Base 1 Private Sub Command1_Click() Dim a(3,3) As Integer For m=1 To 3 For n=1 To 3 a(m-1,n-1)=m+n+1 Next n Next m For m=0 To 2 For n=0 To 2 Print a(n,m); Next n Print Next m End Sub
对窗体编写如下代码: Option Base 1 Private Sub Form_ KeyPress (KeyAscii As Integer) a=Array(237,126,87,48,498) m1=a(1) m2=1 If KeyAscii=13 Then For i=2 To 5 If a(i)>m1 Then m1=a(I) m2=i End If Next i End If Print m1 Print m2 End Sub 程序运行后,按回车键,输出结果为______ 。
对窗体编写如下代码,当程序运行后,按回车键,输出结果为 ______。 Option Base 1 Private Sub Form. KeyPress(KeyAscii As Integer) a = Array(237,126,87,48,498) m1 = all) m2= 1 If KeyAscii = 13 Then For i = 2 To 5 If a(i)>m1 Then m1 = a(j) m2= i End If Next i End If Print m1 Print m2 End Sub
下列程序运行时输出的结果是( )。 Option Base 1 Private Sub Form_Click() Dimx(10) ForI=1 to 10 x(i)=10-I+1 Next I ForI=10 to 1 step-2 Printx(i); NextI End Sub
广告位招租WX:84302438

免费的网站请分享给朋友吧