vb作业题 急求

来源:百度知道 编辑:UC知道 时间:2024/06/14 10:37:55
请用双重循环,完成这种界面呀:
ABCDEFGHI
ABCDEFG
ABCDE
ABC
A
谢谢了
直接单击窗体就行了

刚替别人完成,已经被采纳了。自己运行看看吧
Private Sub Command1_Click()
Dim n%
n = Val(InputBox("请输入一个整数"))
For i = 1 To n
Print Tab(i);
For j = 1 To 2 * (n - i) + 1
Print String(1, 64 + j);
Next j
Next i
End Sub

Option Explicit
Private Sub Command1_Click()
Dim s As String * 1
Dim strT$()
Dim n As Integer, i As Integer, j As Integer, t As Integer
s = UCase(Text1)
n = Val(Text2)
ReDim strT(n)
For i = 1 To n
For j = 1 To 2 * i - 1
t = Asc(s) + j - 1
If (t >= Asc("A") And t <= Asc("Z")) Then
strT(i) = strT(i) & Chr(t)
Else
strT(i) = strT(i) & Chr(t - 26)
End If
Next j
Picture1.Print Tab(15 - i); strT(i)
Next i
End Sub

是个类似的题,你运行看看!

Private Sub Command1_Click(