当执行以下程序时,在名为label1的标签框内将显示_____。 Private Sub command1_click() s=0 For I=1 To 5 Step 1 s=s+I Next I label1.Caption=s End Sub
举一反三
- 当执行以下程序时,在名为lblResult的标签框内将显示_____。 Private Sub cmdlt_click() Dim I,R R=0 For I=1 To 5 Step 1 R=R+I Next I lblResult.Caption=Str(R) End Sub
- 运行下列程序,单击窗体显示的结果为( )。 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 Form_Click() K=1 For I=5 to 1 step -1 T=T*10 + K S=S+T Next I Print S End sub
- 下列程序: Option Base 1 Private Sub Form_Click() Dim a(5,5) For i = 1 To 5 For j = 1 To 5 k = k + 1 a (i,j)= k Next j Next i For i = 1 To 5 s = s + a (i,i) Next i Print s End Sub 运行时的输出结果是( )。
- 窗体上有一标签Label1,将1~9连接成123456789的9位数,显示在标签中。应该在填入的内容,完善程序。 Dim i%, s& s = 0 For i = 1 To 9 s = ___________ Next Label1.Caption = s