Option Explicit Private Sub Command1_Click() Dim a(4, 4) As Integer, k As Integer Dim i As Integer,
执行下面程序,单击command1按钮,则数组元素a(2,1)的值是——OptionExplicitPrivateSubCommand1_Click()Dima(4,4)...
执行下面程序,单击command1按钮,则数组元素a(2,1)的值是——
Option Explicit
Private Sub Command1_Click()
Dim a(4, 4) As Integer, k As Integer
Dim i As Integer, j As Integer, m As Integer, n As Integer
For m = 1 To 4
j = m
For n = 1 To 4
k = k + 1
a(n, j) = k
j = j - 1
Next n
Next m
For n = 2 To 4
i = n
For m = 4 To n Step -1
k = k + 1
a(i, m) = k
i = i + 1
Next m
Next n
For n = 1 To 4
For m = 1 To 4
Text1 = Text1 & Right(" " & Str(a(n, m)), 3)
Next
Text1 = Text1 & vbCrLf
Next n
End Sub
我也发现调试有问题,可是是原题啊。。。06秋季江苏vb二级考试编程填空第二题
Private Sub Command1_Click()
Dim a(4, 4) As Integer, k As Integer
Dim i As Integer, j As Integer, m As Integer, n As Integer
For m = 1 To m
j = m
For n = 1 To 4
k = k + 1
a(n, j) = k
j = j - 1
Next n
Next m
For n = 2 To 4
i = n
For m = 4 To n Step -1
k = k + 1
a(i, m) = k
i = i + 1
Next m
Next n
For n = 1 To 4
For m = 1 To 4
Text1 = Text1 & Right(" " & Str(a(n, m)), 3)
Next
Text1 = Text1 & vbCrLf
Next n
End Sub 展开
Option Explicit
Private Sub Command1_Click()
Dim a(4, 4) As Integer, k As Integer
Dim i As Integer, j As Integer, m As Integer, n As Integer
For m = 1 To 4
j = m
For n = 1 To 4
k = k + 1
a(n, j) = k
j = j - 1
Next n
Next m
For n = 2 To 4
i = n
For m = 4 To n Step -1
k = k + 1
a(i, m) = k
i = i + 1
Next m
Next n
For n = 1 To 4
For m = 1 To 4
Text1 = Text1 & Right(" " & Str(a(n, m)), 3)
Next
Text1 = Text1 & vbCrLf
Next n
End Sub
我也发现调试有问题,可是是原题啊。。。06秋季江苏vb二级考试编程填空第二题
Private Sub Command1_Click()
Dim a(4, 4) As Integer, k As Integer
Dim i As Integer, j As Integer, m As Integer, n As Integer
For m = 1 To m
j = m
For n = 1 To 4
k = k + 1
a(n, j) = k
j = j - 1
Next n
Next m
For n = 2 To 4
i = n
For m = 4 To n Step -1
k = k + 1
a(i, m) = k
i = i + 1
Next m
Next n
For n = 1 To 4
For m = 1 To 4
Text1 = Text1 & Right(" " & Str(a(n, m)), 3)
Next
Text1 = Text1 & vbCrLf
Next n
End Sub 展开
3个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询