VB编程 九九乘法表 右下三角形

全部程序要求打印输出的字体:fontsize=30要求如下图
2024-12-25 18:18:32
推荐回答(2个)
回答1:

Private Sub Command1_Click()

Me.FontSize = 30'字体大小 30有点大,超出窗口范围了

Dim i As Integer
Dim j As Integer
Dim s As String

For i = 1 To 9
For j = 1 To i
s = CStr(i) & "*" & CStr(j) & "=" & CStr(i * j)
s = s & Space$(10 - Len(s))
Print s;
Next j
Print
Next i
End Sub

回答2:

Private Sub Form_Click()
FontSize = 30
b = " 九九乘法表": Print b
For i = 1 To 9
For j = 1 To i
a = CStr(j) & "*" & CStr(i) & "=" & CStr(j * i) & " "
Print a;
If i = j Then Print
Next j
Next i
End Sub