急呀,怎用用VB 打出字母金字塔
展开全部
Sub Command1_Click()
Dim i As Integer, m As Integer, n As Integer
n = 64
For i = 1 To 5
Print Space(5 - i);
For m = 1 To 2 * i - 1
n = n + 1
Print Chr(n);
Next
Print ""
Next
End Sub
一句话的提问,很难完全明白你的意思!!
这是运行结果:
A
BCD
EFGHI
JKLMNOP
QRSTUVWXY
追问
如果字母之间有空格符,怎么写代码?谢谢
追答
下面是字母间用空格的代码!
Sub Command1_Click()
Dim i As Integer, m As Integer, n As Integer
n = 64
For i = 1 To 6
Print Space(6 - i);
For m = 1 To i
n = n + 1
Print Chr(n); " ";
Next
Print ""
Next
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询