某VB程序功能如下:输入正整数n,单击命令按钮Command1后,则会生成一串有规律的数字序列,形式为“n n-1 n-2 … 3 2 1 2 3 … n-2 n-1 n”。例如n=8时,生成的数字序列如图所示。代码如下:
Private Sub Command1_Click()
Dim n As Integer, i As Integer, s As String
n = Val(Text1.Text)
s = ""
For i = 1 To 2 * n - 1
If i <= n Then ① Else ②
Next i
Label1.Caption = s
End Sub
为实现以上功能,划线①②处应分别填写( )
- A、①s = s & Str(n - i + 1) ②s = s & Str(i - n + 1)
- B、①s = Str(n - i + 1) ②s = Str(i - n + 1)
- C、①s = s & Str(i - n + 1) ②s = s & Str(n - i + 1)
- D、①s = Str(i - n + 1) ②s = Str(n - i + 1)