更多"在窗体上画一个名为Command1的命令按钮,然后编写如下程序:
"的相关试题:
[单项选择]在窗体上画一个名为Command 1的命令按钮,然后编写如下程序:
Option Base 1
Private Sub Command1_Click( )
Dim Arr
Arr=Array(1, 2, 3, 4, 5)
j=1
For i=5 To 1 Step -1
S=S+Arr(i)*j
j=j*10
Next
Print S
End Sub
程序运行后,单击命令按钮,输出结果为( )。
A. 54321
B. 123
C. 12345
D. 345
[单项选择]在窗体上画一个名为Command1的命令按钮,然后编写如下代码:
Option Base 1
Private Sub Command1_Click( )
Dim a
a=Array(1,2,3,4)
j=1
For i=3 To 1 Step-1
s=s+a(i)*j
j=j*10
Next i
Print s
End Sub
运行上面的程序,其输出结果是
A. 1234
B. 12
C. 34
D. 4321
[单项选择]在窗体上画一个名为Command1的命令按钮,然后编写如下代码: Option Base 1 Private Sub Command1_ Click( ) Dim arr(4, 4) For i = 1 To 4 For j = 1 To 4 arr(i, j) = (i - 1) * 3 + j Next j Next i For i = 1 To 2 For j = 1 To 2 Print arr(i, j) Next j Next i End Sub程序运行后,单击命令按钮,输出结果为______ 。
A. 3 4 6 7
B. 7 8 10 11
C. 1 2 4 5
D. 8 9 12 13
[单项选择]在窗体上画一个名为Command1的命令按钮,然后编写如下程序:
Option Base 1
Private Sub Command1_Click( )
Dim Arr
Arr = Array(1,2,3,4,5)
j=1
For i = 5 To 1 Step -1
S = S + Art(i) * j
j =j * 10
Next
Print S
End Sub
程序运行后,单击命令按钮,输出结果为( )。
A. 54321
B. 123
C. 12345
D. 345
[单项选择]在窗体上画一个名为Command1的命令按钮,然后编写下列程序:
Option Base 1
Private Sub Command1_Click( )
Dim Arr
Arr=Array(1,2,3,4,5)
j=1
For i=5 To 1 Step-1
S=S+Arr(i)*j
j=j*10
Next
Print S
End Sub
程序运行后,单击命令按钮,输出结果是( )。
A. 54321
B. 123
C. 12345
D. 345
[填空题]在窗体上画一个命令按钮,其名称为command1,然后编写如下代码:
Option Base 1
Private Sub Command1_ Click( )
Dim Arr
Arr = Array(43, 68f -25, 65, -78, 12, -79, 43, -94, 72)
pos = 0
neg = 0
For k = 1 To 10
If Art(k) > 0 Then
Else
End If
Next k
Print pos, neg
End Sub
以上程序的功能是,计算并输出数组Arr中10个数的整数之和pos与负数之和neg,请填空。
[单项选择]在窗体上画一个命令按钮,其名称为Command1,然后编写如下程序:
Option Base 1
Private Sub Command1_Click( )
Dim a As Variant
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
运行上面的程序,单击命令按钮,其输出的结果为
A. 4321
B. 12
C. 34
D. 1234
[填空题]在窗体上画一个命令按钮,其名称为Command1,然后编写如下代码:
Option Base 1
Private Sub Command1_Click( )
Dim Arr
Arr=Array(43,68,-25,65,-78,12,-79,43,-94,72)
pos=0
neg=0
For k=1 To 10
If Arr(k)>0 Then
(11)
Else
(12)
End If
Next k
Print pos,neg
End Sub
以上程序的功能是:计算并输出数组Arr中10个数的正数之和pos与负数之和neg,请填空。
[单项选择]在窗体上画一个命令按钮,名称为Command1,然后编写如下代码:
Option Base 0
Private Sub Commandl_Click( )
Dim A(4)As integer,B(4)As Integer
For k=0 To 2
A(k+1)=InputBox("请输入一个整数")
B(3-k)=A(k+1)
Next k
Print B(k)
End Sub
程序运行后,单击命令按钮,在输入对话框中分别输入2、4、6,输出结果为【 】
A. 0
B. 2
C. 3
D. 4
[单项选择]在窗体上画一个命令按钮,名称为Command1,然后编写下列代码:
Option Base 0
Private Sub Command1 Click( )
Dim A1(4)As Integer,A2(4)As Integer
For k=0 To 2
A1(k+1)=InputBox(”请输入一个整数”)
A2(3-k)=A1(k+1)
Next k
Print A2(k)
End Sub
程序运行后,单击命令按钮,在输入对话框中依次输入2、4、6,则输出结果为( )。
A. 0
B. 1
C. 2
D. 3