设有命令按钮 Command1 的单击事件过程,代码如下:Private Sub Command1_Click() Dim a(3,3) As IntegerFor i=1 To 3For j=1 To 3a(i,j)=i*j+iNext j Next iSum=0For i=1 To 3Sum=Sum+a(i,4-i) Next iPrint SumEnd Sub运行程序,单击命令按钮,输出结果是______。
A: 20
B: 7
C: 16
D: 17
A: 20
B: 7
C: 16
D: 17
举一反三
- 在窗体上面添加一个命令按钮Command1,然后编写如下事件过程: Private Sub Command1_Click() Dim a1(4, 4), a2(4, 4) For i = 1 To 4 For j = 1 To 4 a1(i, j) = i + j a2(i, j) = a1(i, j) + i + j Next j Next i Print a1(3, 3); a2(3, 3) End Sub 程序运行后,单击命令按钮,在窗体上输出的内容是( )
- 在窗体上画一个命令按钮,其名称为Command1,然后编写如下事件过程: Private Sub Command1_Click() Dim a1(4, 4), a2(4, 4) For i = 1 To 4 For j = 1 To 4 a1(i, j) = i + j a2(i, j) = a1(i, j) + i + j Next j Next i Print a1(3, 3); a2(3, 3) End Sub 程序运行后,单击命令按钮,在窗体上输出的是.
- 窗体上有一个命令按钮Command1,编写如下事件过程: Private Sub Command1_Click() For i=1 to 4 For j=4 to 8 sum=sum+1 Next j Next i Print sum End Sub 运行时,单击按钮,输出结果是( )
- 中国大学MOOC: 在窗体上添加一个命令按钮Command1,编写如下事件过程,运行时单击按钮,显示结果为( )。Private Sub Command1_Click() For i = 1 To 4 For j = 4 To 8 Sum = Sum + 1 Next j Next i Print SumEnd Sub
- 在窗体上画一个名为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