如何用VB编10*10的矩阵 对角线用1输出 其余用0输出
展开全部
Option Explicit
Private Sub output()
Dim i As Integer, j As Integer
For i = 0 To 9
For j = 0 To 9
'Print i; ","; j; " ";
If i = j Or i + j = 9 Then
Print "1 ";
Else
Print "0 ";
End If
Next
Print
Next
End Sub
Private Sub Form_Load()
AutoRedraw = True
output
End Sub
Private Sub output()
Dim i As Integer, j As Integer
For i = 0 To 9
For j = 0 To 9
'Print i; ","; j; " ";
If i = j Or i + j = 9 Then
Print "1 ";
Else
Print "0 ";
End If
Next
Next
End Sub
Private Sub Form_Load()
AutoRedraw = True
output
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询