阅读程序: 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 程序运行后,单击窗体,输出结果为______。
A: 13
B: 14
C: 27
D: 15
A: 13
B: 14
C: 27
D: 15
举一反三
- 在窗体上画一个名为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
- 下面程序运行后的结果为___ Private Sub Form_Click() Dim i%, sum% i = 1 Do While i < 5 sum = sum + i * i i = i + 2 Loop Print sum End Sub A: 45 B: 35 C: 10 D: 25
- 执行下列程序后,输出的结果是 Option Base 1 Private Sub Form_Click() Dim arr, s As Integer s = 0 arr = Array(2, 4, 6, 8, 10, 12, 14, 16, 18, 20) For i = 1 To 10 Step 2 If arr(i) Mod 3 = 0 Then s = s + arr(i) End If Next i Print s End Su A: 20 B: 22 C: 24 D: 26 E: 28 F: 其它都不对
- 中国大学MOOC: var arr = [2,3,4,5,6]; var sum =0; for(var i=1;i < arr.length;i++) { sum +=arr[i] } console.log(sum);
- 智慧职教: var arr = [2,3,4,5,6]; var sum =0; for(var i=1;i < arr.length;i++) { sum +=arr[i] } console.log(sum);[/i]