作业帮 > 综合 > 作业

VB打印9格图形1 然后再转成2 (1)1 2 3 (2)1 4 7 4 5 6 2 5 8 7 8 9 3 6 9

来源:学生作业帮 编辑:神马作文网作业帮 分类:综合作业 时间:2024/11/11 06:05:51
VB打印9格图形1 然后再转成2 (1)1 2 3 (2)1 4 7 4 5 6 2 5 8 7 8 9 3 6 9
还有打印:
1 0 0 0 1
0 1 0 1 0
0 0 1 0 0
0 1 0 1 0
1 0 0 0 1
打印
1 2 3
4 5 6
7 8 9
再转换
1 4 7
2 5 8
3 6 9
VB打印9格图形1 然后再转成2 (1)1 2 3 (2)1 4 7 4 5 6 2 5 8 7 8 9 3 6 9
‘自己拆分一下,我写在一起了:
Private Sub Command1_Click()
Dim i As Integer,j As Integer
For i = 1 To 9
Print i;
If i Mod 3 = 0 Then Print
Next
Print
For i = 1 To 3
Print i;
For j = i + 3 To i + 6 Step 3
Print j;
Next
Print
Next
Print
For i = 1 To 5
For j = 1 To 5
If i = j Or i = 6 - j Then Print 1; Else Print 0;
Next
Print
Next
End Su