题库 高中信息

题干

(加试题)某VB程序功能:输入正整数n,单击命令按钮Command1后,则会衍生出一串有规律的数字,形式为“1 2 3…n-1 n n-1…3 2 1 ”。例如n=6时,显示的数字串为“1 2 3 4 5 6 5 4 3 2 1 ”。
Private Sub Command1_Click()
Dim a As intger, i As intger, s As String
n = Val(Text1.Text)
s = ""
For i = 1 To 2 * n - 1
If i > n Then   Else    
Next i
text2.Text = s
End Sub
为实现以上功能,①②处分别填写(    )
A.①s=Str(2*n-i)    ②s=Str(i)B.①s=s+Str(2*n-i)  ②s=s+Str(i)
C.①s=s+Str(2*n-1)  ②s=s+Str(2*n)D.①s= Str(2*n-1)   ②s= Str(2*n)
上一题 下一题 0.99难度 选择题 更新时间:2017-02-17 10:36:52

答案(点此获取答案解析)