网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)

( 32 )设有以下程序:

Private Sub Form_Click()

X=50

For i=1 To 4

Y=InputBox( “ 请输入一个整数 ” )

Y=Val(y)

If y Mod 5=0 Then

a=a+y

x=y

Else

a=a+x

End If

Next i

Print a

End Sub

程序运行后,单击窗体,在输入对话框中依次输入 15 、 24 、 35 、 46 ,输出结果为

A ) 100

B ) 50

C ) 120

D ) 70


参考答案

更多 “ ( 32 )设有以下程序:Private Sub Form_Click()X=50For i=1 To 4Y=InputBox( “ 请输入一个整数 ” )Y=Val(y)If y Mod 5=0 Thena=a+yx=yElsea=a+xEnd IfNext iPrint aEnd Sub程序运行后,单击窗体,在输入对话框中依次输入 15 、 24 、 35 、 46 ,输出结果为A ) 100B ) 50C ) 120D ) 70 ” 相关考题
考题 下列程序执行时,从键盘上依次输入123和234,则程序的输出结果是【 】。a=InputBox("请输入第一个整数")b=InputBox("请输入第二整数")Print a+b

考题 设有如下程序: Private Sub Commandl_click() Dim c As Integer,d As Integer c=4 d=InputBox("请输入一个整数") Do While d>0 If d>c Then c=c+1 End If d=InputBox("请输入一个整数") Loop Print c+d End Sub 程序运行后,单击命令按钮,如果在输入对话框中依次输入1、2、3、4、5、6、7、8、9、 0,则输出结果是A.12B.11C.10D.9

考题 设有如下程序:Private Sub Command1_Click()Dim c As Integer, d As Integerc = 4d = InputBox("请输入一个整数")Do While d 0If d c Then c = c + 1End If d = InputBox("请输入一个整数")LoopPrint c + dEnd Sub程序运行后,单击命令按钮,如果在输入对话框中依次输入1、2、3、4、5、6、7、8、9、0,则输出结果是( )。A.12B.11C.10D.9

考题 在窗体上画一个命令按钮,命名为Command1。程序运行后,如果单击命令按钮,则显示一个输入对话框,在该对话框中输入一个整数,并用这个整数作为实参调用函数过程F1,在F1中判断所输入的整数是否是奇数,如果是奇数,过程F1返回1,否则F1返回1,否则返回0。能够正确实现上述功能的代码是 。A.Private Sub Command1_Click() x=InputBox("请输入整数") a=F1(Val(x)) Print a End Sub Function F1(ByRef b As Integer) If b Mod 2=0 Then Return 0 Else Return 1 End If End FunctionB.Private Sub Command1_Click() x=InputBox("请输入整数") a=F1(Val(x)) Print a End Sub Function F1(ByRef b As Integer) If b Mod 2=0 Then F1= 0 Else F1= 1 End If End FunctionC.Private Sub Command1_Click() x=InputBox("请输入整数") F1(Val(x)) Print a End Sub Function F1(ByRef b As Integer) If b Mod 2=0 Then F1= 1 Else F1= 0 End If End FunctionD.Private Sub Command1_Click() x=InputBox("请输入整数") F1(Val(x)) Print a End Sub Function F1(ByRef b As Integer) If b Mod 2=0 Then Return 0 Else Return 1 End If End Function

考题 设有如下程序: Private Sub Command1_Click( ) Dim c As Integer,d As Integer c=4 d=InputBox(“请输入一个整数”) Do While d>0 If d>c Then C=C+1 End lf d=InputBox(“请输入一个整数”) Loop Print c+d End sub 程序运行后,单击命令按钮,如果在输入对话框中依次输入1、2、3、4、5、6、7、8、9、0,则输出结果是A.12B.11C.10D.9

考题 设有如下程序: Private Sub Command1_Click() Dim C As Integer, d As Integer c=4 d=InputBox(“请输入一个整数”) Do While d>0 If d>c Then c=c+1 End If d=InputBox(“请输入一个整数”) Loop Print c+d End Sub 程序运行后,单击命令按钮,如果在输入对话框中依次输入1、2、3、4、5、6、7、8、 9和0,则输出结果是A.12B.11C.10D.9

考题 设有如下程序: Private Sub Command1_Click() Dim c As Integer,d As Integer c=4 d=InputBox("请输入一个整数") Do While d>0 If d>c Then c=c+1 End If d=InputBox("请输入一个整数") Loop Print c+d End Sub 程序运行后,单击命令按钮,如果在输入对话框中依次输入1、2、3、4、5、6、7、8、9和0,则输出结果是( )。A.12B.11C.10D.9

考题 设有如下程序: Private Sub Command1_Click() Dim C As Integer, d As Integer c=4 d=InputBox("请输入一个整数") Do While d>0 If d>c Then c=c+1 End If d=InputBox("请输入一个整数") Loop Print c+d End Sub 程序运行后,单击命令按钮,如果在输入对话框中依次输入1、2、3、4、5、6、7、8、9、0,则输出结果是______。A.12B.11C.10D.9

考题 以下程序段的作用是首先按降序输入10个数到数组Y的前10个元素中,又输入一个YO插入到数组Y中,插入YO后Y中的数据仍按降序排列。请补充完该程序______。Dim Y(1 To 11)For i =1 To 10Y(i) = Val(InputBox(“请输入Y(i):”))Next iX = Val(InputBox (“请输入x:”))For i = 10 To 1 Step -1If【 】ThenY(i + 1) = XExit ForEnd IfY (i + 1) =Y(i)Next i'Print Y(10)For i =1 To 11Print Y(i)Next I