下面程序计算并输出的是_______。 Private Sub Command1_Click() a=10 s=0 Do s=s+a*a*a a=a-1 Loop Until a<=0 Print s End Sub
举一反三
- 程序执行结果S的值是 【11】 。 Private Sub Command1_Click() i=0 Do i=i+1 s=i+s Loop Until i>=4 Print s End Sub
- 程序执行结果s的值是 【14】 . Private Sub Command l-Click () I =0 Do S= I +S I = I + l Loop Until I >=4End Sub
- 下面程序的输出结果是 Private Sub Command1_Click() ch$="ABCDEF" proc ch Print ch End Sub Private Sub proc(ch As String) S="" For k=Len(ch) To 1 Step-1 s=s & Mid(ch,k,1) Next k ch=s End Sub
- 有如下程序段:s = 0For i = 1 To 10 s = s + iNext iPrint s与上述程序段输出结果相同的程序段为( )。 A: s = 0: i = 0 While i <= 10 i = i + 1 s = s + i Wend Print s B: s = 0: i = 1 While i < 10 i = i + 1 s = s + i Wend Print s C: s = 0: i = 1 Do s = s + i i = i + 1 Loop While i < 10 Print s D: s = 0: i = 1 Do s = s + i i = i + 1 Loop Until i > 10 Print s
- 编写如下程序: Private Sub Command1_Click() Dim n As Integer : Static s As Integer For n = 1 To 3 s = s + n Next Print s End Sub 程序运行后,第三次单击命令按钮Command1时,输出结果为