执行下面程序段后,输出的结果为( )。 Dim m(5) As Integer s = 0 For i = 0 To 5 m(i) = 5 Next i For j = 0 To 5 s = s + m(j) Next j Print s
举一反三
- 下列程序中 s = s + j 语句共执行了______次。 Dim s As Integer Dim i As Integer, j As Integer For i = 1 To 10 Step 2 For j = 1 To 5 Step 2 s = s + j Next j Next i Print s
- 执行下列程序段后,程序的运行结果为()。 s = 1 For i = 1 To 3 For j = 0 To i - 1 s = s + s * j Next j Print s; Next i
- 下列程序段的执行结果为 _______。 Dim a(3, 5) As Integer Dim i As Integer, j As Integer For i = 1 To 3 For j = 1 To 5 a(i, j) = a(i - 1, j - 1) + (i - 1) * 5 + j Next j Next i Print a(3, 4)
- 单击窗体,在窗体上打印数列:2/1 ,3/2 ,5/3 ,8/5 ,13/8 … 的前10项,并求其和,将和保存在变量s中。 Private Sub Form_Click() Dim i%, j%, k%, m As Integer Dim s As Single s = 0 i = 2 'i为分子 j = 1 'j为分母 For k = 1 To 10 s = 【1】 Print i & "/" & j m = j j = i i = 【2】 Next Print s End Sub
- 执行下面程序段后,输出的结果为( )。 Dimm(5)AsInteger s=0 Fori=0To5 m(i)=5 Nexti Forj=0To5 s=s+m(j) Nextj Prints