几道VB编程题~~求高手帮忙~~!!!!

2024-12-19 04:10:54
推荐回答(1个)
回答1:

Private Sub Command1_Click()
Form1.Cls
a = InputBox("请输入一个数。")
If IsNumeric(a) Then
a = CInt(a)
If a >= 3 Then
For i = 0 To a - 1
Print Space(a - 1 - i) + String(2 * i + 1, Chr(65 + i)) + Space(a - 1 - i)
Next
For i = a - 2 To 0 Step -1
Print Space(a - 1 - i) + String(2 * i + 1, Chr(65 + i)) + Space(a - 1 - i)
Next
End If
End If
End Sub