VB 编写数字三角形(要具体代码)
编写出来的是这个样子的:123456789123456789123456789123456789谢谢啊==好的有高分=...
编写出来的是这个样子的:
1
2 3 4
5 6 7 8 9
1 2 3 4 5 6 7
8 9 1 2 3 4 5 6 7
8 9 1 2 3 4 5 6 7 8 9
谢谢啊==好的有高分= 展开
1
2 3 4
5 6 7 8 9
1 2 3 4 5 6 7
8 9 1 2 3 4 5 6 7
8 9 1 2 3 4 5 6 7 8 9
谢谢啊==好的有高分= 展开
1个回答
展开全部
Option Explicit
Private Sub Command1_Click()
Dim i As Integer, j As Integer, k As Integer, l As Integer, m As Integer
k = 1
For i = 1 To 6
Print ""
l = 6 - i - 1
For m = l To 0 Step -1
Print " ";
Next m
For j = 1 To i * 2 - 1
Print k;
k = k + 1
If k = 10 Then k = 1
Next j
Next i
End Sub
Private Sub Command1_Click()
Dim i As Integer, j As Integer, k As Integer, l As Integer, m As Integer
k = 1
For i = 1 To 6
Print ""
l = 6 - i - 1
For m = l To 0 Step -1
Print " ";
Next m
For j = 1 To i * 2 - 1
Print k;
k = k + 1
If k = 10 Then k = 1
Next j
Next i
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询