一道vb试题求解答
OptionExplicitPrivateSubCommand1_Click()Dima(4,4)AsInteger,iAsIntegerDimjAsInteger,kA...
Option Explicit
Private Sub Command1_Click()
Dim a(4, 4) As Integer, i As Integer
Dim j As Integer, k As Integer, n As Integer
n = 6: k = 2
Do
For i = 1 To 4
For j = 1 To 4
If i + j = k Then
a(i, j) = n
n = n - 1
End If
Next j
Next i
k = k + 1
Loop Until k > 8
For i = 1 To 4
For j = 1 To 4
Print Right(" " & a(i, j), 3);
Next j
Print
Next i
End Sub
这是09年秋二级VB题目,问a(1.2)a(2,3)a(4,3)的值是多少?答案分别是15,9,2。我不知道怎么算的,有哪位高人能指点指点,要详细点
那5,-1,-8,又是怎么算的呢? 展开
Private Sub Command1_Click()
Dim a(4, 4) As Integer, i As Integer
Dim j As Integer, k As Integer, n As Integer
n = 6: k = 2
Do
For i = 1 To 4
For j = 1 To 4
If i + j = k Then
a(i, j) = n
n = n - 1
End If
Next j
Next i
k = k + 1
Loop Until k > 8
For i = 1 To 4
For j = 1 To 4
Print Right(" " & a(i, j), 3);
Next j
Next i
End Sub
这是09年秋二级VB题目,问a(1.2)a(2,3)a(4,3)的值是多少?答案分别是15,9,2。我不知道怎么算的,有哪位高人能指点指点,要详细点
那5,-1,-8,又是怎么算的呢? 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询