如何使用VB的控制台应用程序编写一个倒直角三角形的乘法口诀表?_百度...
发布网友
发布时间:2024-01-06 15:49
我来回答
共2个回答
热心网友
时间:2024-08-04 15:47
添加一个模块,模块里写:
Sub Main()
Dim i As Integer, j As Integer, x As String
Form1.Show
Form1.Cls
Form1.AutoRedraw = True
Form1.Caption = "乘法口诀表"
For i = 1 To 9
For j = 1 To i
x = j & "×" & i & "=" & i * j
Form1.Print x; Space(7 - Len(x));
Next j
Form1.Print
Next i
End Sub
然后,在“工程”-“属性”-“通用”里设置启动对象为Sub Main(),再执行,或者生成exe文件
热心网友
时间:2024-08-04 15:48
不是windows应用程序而是控制台应用程序 看不懂用vb做那代码就是下面这个了
Private Sub Command1_Click()
Picture1.Cls
Dim i As Integer, j As Integer
Dim ex As String
For i = 1 To 9
For j = 1 To i
ex = j & "×" & i & "=" & i * j
Picture1.Print Tab((j - 1) * 8 + 3); ex;
Next j
Picture1.Print
Next i
End Sub