VB二维数组
建立一个五行五列的二维数组,要求两对角线上的元素为0,其余为1,并且在窗体上打印输出,要求两列数字之间空三格(不包括符号位),两行之间空一行。快考试了,急救!!...
建立一个五行五列的二维数组,要求两对角线上的元素为0,其余为1,并且在窗体上打印输出,要求两列数字之间空三格(不包括符号位),两行之间空一行。
快考试了,急救!! 展开
快考试了,急救!! 展开
1个回答
展开全部
'修改后
Private Sub Command1_Click()
Dim S(1 To 5, 1 To 5) As Long, I As Long, J As Long
Me.Cls: Me.AutoRedraw = True
For I = 1 To 5
For J = 1 To 5
If I <> J And 6 - I <> J Then S(I, J) = 1
Print " " & S(I, J);
Next
Print vbCrLf
Next
End Sub
Private Sub Command1_Click()
Dim S(1 To 5, 1 To 5) As Long, I As Long, J As Long
Me.Cls: Me.AutoRedraw = True
For I = 1 To 5
For J = 1 To 5
If I <> J And 6 - I <> J Then S(I, J) = 1
Print " " & S(I, J);
Next
Print vbCrLf
Next
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询