Private Sub Command2_Click()
cls
n = InputBox("输入数字")
If n > 26 Or n < 1 Then
MsgBox "输入1-24之间的数"
Exit Sub
End If
For i = 1 To n
Print String(n - i, " ") & String(i, Chr(64 + i)) & String(i - 1, Chr(64 + i))
Next i
End Sub
运行结果如下:
Private Sub Command1_Click()
Dim a As Integer, c As String
a = InputBox("请输入数字且不大于26小于0", "", "1")
If a < 26 Then
For e = 1 To a
c = ""
For f = 1 To e
c = c + Chr(64 + e)
Next f
Me.Print c
Next e
End If
End Sub
不知道这是不是你需要的
Dim N As Integer
N = InputBox("请输入数字", "")
For i = 1 To N
Print Space(N - i);
For j = 1 To i
Print Chr(64 + i) & " ";
Next
Print
Next
不要放在窗体加载过程中,如果想放在窗体加载的过程中,要把窗体的AutoRedraw属性改成True。
k=Val(Inputbox())
Select Case k
Case 1 : p="A"
Case 2 : p="B"
Case 3 : p="C"
Case 4 : p="D"
.................
End Select
其他就不用说了吧!