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

来源:百度知道 编辑:UC知道 时间:2024/05/17 13:28:17
全部程序要求打印输出的字体:fontsize=30
要求如下图

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

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