vb一道题,帮我看看我的要怎么修改才对,如果能帮我,追加200悬赏,十分感谢

2025-05-14 21:52:24
推荐回答(4个)
回答1:

Private Sub Form_Activate()
  Call pict
End Sub

Public Sub pict()
Dim i As Integer, j As Integer
For i = 1 To 9
  Print Tab(12 - i);
  For j = 1 To 2 * i - 1
    If i Mod 2 = 0 Then
        If j Mod 2 = 0 Then
            Print " ";
        Else
            Print Chr(49 + i - 1);
        End If
    Else
        If j Mod 2 = 0 Then
            Print " ";
        Else
            Print Chr(65 + i - 1);
        End If
    End If
  Next j
  Print
Next i
End Sub

回答2:

Option Explicit

Private Sub Form_Activate()
  Call pict
End Sub

Public Sub pict()
Dim i As Integer, j As Integer
For i = 1 To 9
  Print Tab(12 - i);
  For j = 1 To 2 * i - 1
    If j Mod 2 = 0 Then
        Print " ";
    Else
        If i Mod 2 = 0 Then
            Print CStr(i);
        Else
            Print Chr(65 + i - 1);
        End If
    End If
  Next j
  Print
Next i
End Sub

效果:

回答3:

Private Sub Form_Activate()
Call pict
End Sub
Public Sub pict()
Dim i As Integer, j As Integer
Dim n As Integer
For i = 1 To 9
Print Tab(12 - i);
For j = 1 To 2 * i - 1
If j Mod 2 = 1 Then
If i Mod 2 = 1 Then
Print Chr(65 + i - 1);
Else
Print CStr(i);
End If
Else
Print " ";
End If
Next j
Print
Next i
End Sub

回答4:

你这个只有字母没有数字的