题型:综合题 题类:常考题 难易度:普通
浙江省七彩阳光新高考研究联盟2020-2021学年高二下学期信息技术期中联考试卷
Private Sub Command1_Click()
Dim a(1 To 100) As String
Dim i As Integer, j As Integer, m As Integer, n As Integer
Dim ts As String, t As Integer, v As Integer
n = Val(Text1.Text)
v =
t = 1
For m = n To 1 Step -2
For i = 1 To m '向右方向填数
a(t + i - 1) = Chr(Asc("A") + v - 1)
v = v - 1
Next i
t = t + n - 1
For i = 1 To m - 1 '向下方向填数
a(m + t) = Chr(Asc("A") + v - 1)
v = v - 1
Next i
t = t - n
For i = m - 1 To 1 Step -1 '向左方向填数
a(t + i) = Chr(Asc("A") + v - 1)
v = v - 1
Next i
For i = m - 2 To 1 Step -1 '向上方向填数
a(t - n + 1) = Chr(Asc("A") + v - 1)
v = v - 1
t = t - n
Next i
t = t + 2
Next m
For i = 1 To n '在List1 中输出数组数据
ts = ""
For j =To i * n
ts = ts + " " + a(j)
Next j
List1.AddItem ts
Next i
End Sub
试题篮