编写如下程序:Dim num As Integer,r As Integer,n As Integer,i As Integer,arr(5)As IntegerPrivate Sub Command1_Click( )num=12:r=2Call sub1(num,r,n)For i=n To1Step-1Print arr(i);Next iEnd SubSub sub1(d As Integer,r As Integer,k As Integer)k=0Do While d<>0k=k+1:arr(k...
编写如下程序:Dim num As Integer, r As Integer, n As Integer, i As IntegerDim arr(5) As IntegerPrivate Sub Command1_Click( ) num = 12: r = 2 Call sub1(num, r, n) For i = n To 1 Step -1 Print arr(i); Next iEnd SubSub sub1(d As Integer, r As Integer, k As Integer...
编写如下程序: Private Sub Command l_Click( )Dim num As Integer,k As Integer,n As Integernum=InputBox(”请输入一个正整数:”)k=num n=2Do Do While num Mod n=0 Print n;:num=num/n Loop n=n+1Loop Until n>k/2 End Sub 程序运行后,单击命令按钮Commandl,并输入数值20,则输出结果为...
在窗体上画一个名称为Commandl的命令按钮,然后编写如下事件过程: Private Sub Commandl_Click( ) Dim i As Integer Dim num As Integer Dim n As Integer n=0 Randomize For i=1 To 10 num=Int(Rnd*10)+1 Select Case hum Mod 2 Case 1 Exit For Case 0 Print num n=n+1 End Select Next i Pr...
在窗体中有一个命令按钮run35,对应的事件代码如下: Private Sub run35_Enter() Dim num As Integer Dim a As Integer Dim b As Integer Dim i As Integer For i= 1 To 10 num = InputBox("请输入数据:", "输入", 1) If Int(num/2) = num/2 Then a=a+1 Else b=b+1 End If Next i ...
在窗体上画一个名称为Command1的命令按钮,然后编写如下事件过程: Private SubCommand1_Click() Dim num As Integer num=1 DO Until mum>6 Print num; num=num+2.4 Loop End Sub 程序运行后,单击命令按钮,则窗体上显示的内容是 ___。 A.1 3.4 5.8B.1 3 5C.1 4 7D.无数据输出 答案 B[解析] 循环共...
窗体中有命令按钮run34,对应的事件代码如下: Private Sub run34_nter( ) Dim num As Integer,a As Integer,b As Integer,i As Integer For i=1 To 10 num=InputBox(“请输入数据:”,“输入”) If Int(num/2)=num/2 Then a=a+l Else b=b+l End If Next i MsgBox(“运行结果:a=“&Str(a...
Dim num As Integer Dim n As Integer n = 0 Randomize For i = 1 To 10 num = Int(Rnd * 10) + 1 Select Case num Mod 2 Case 1 Exit For Case 0 Print num n = n + 1 End Select Next i Print "n="; n End Sub 下面有关描述中正确的是( )。 A. 变量n的作用是累计自过程运行开始...
窗体上有1个名称为Command1的命令按钮,事件过程如下: Private Sub Command1_Click( ) Dim num As Integer,x As Integer num=Val(InputBox(“请输入一个正整数”)) Select Case mum Case Is>100 x=x+num Case Is<90 x=num Case Else x= x* num End Select Print x; End Sub运行程序,并在3次单击...