下列程序段的运行结果是______。 Private Sub Form_Click() Dim d d = Array(1, 2, 3, 4, 5) n = 1 For k = 4 To 2 Step -1 s = s + d(k) * n n = n * 10 Next Print sEnd Sub
A: 123
B: 234
C: 345
D: 112
A: 123
B: 234
C: 345
D: 112
举一反三
- 下列程序运行后输出结果是_______. Private Sub Form_Click() K=1 For I=5 to 1 step -1 T=T*10 + K S=S+T Next I Print S End sub
- 运行下列程序,单击窗体,在窗体上显示的结果为( )。Private Sub Form_Click() a = 0 n = 10 For i = 1 To n Step 2 a = a + 1 n = n + 5 Next i Print aEnd Sub A: 20 B: 10 C: 5 D: 出错
- 运行下列程序,单击窗体显示的结果为( )。 Private Sub Form_Click() Dim a Dim s As Integer, i As Integer a = Array(1, 2, 3) For i = 2 To 0 Step -1 s = s + a(i) * a(i) Next i Print s End Sub
- 下列程序代码的运行结果为( )。 Private Sub Command1_Click() For m = 1 To 10 Step 2 a = 10 For n = 1 To 20 Step 2 a = a + 2 Next n Next m Print a End Sub
- 运行下面的程序,第二行显示结果是___________。 Private Sub Form_Click() Dim A As Integer Dim i As Integer A = 5 For i = 1 To 9 Call sub1(i, A) Print i, A Next i End Sub Private Sub sub1(x As Integer, y As Integer) Static N As Integer Dim I As Integer For I = 3 To 1 Step -1 N = N + x x = x + 2 Next I y = y + N End Sub