求用VB写一个乘法口诀表代码
来源:学生作业帮 编辑:大师作文网作业帮 分类:综合作业 时间:2024/11/10 13:48:38
求用VB写一个乘法口诀表代码
1x1=1
2x1=2 2x2=4
3x1=3 3x2=6 3x3=9
…… …… …… ……
9x1=9 9x2=18 9x3=27 这种形式排列的.
1x1=1
2x1=2 2x2=4
3x1=3 3x2=6 3x3=9
…… …… …… ……
9x1=9 9x2=18 9x3=27 这种形式排列的.
这是比较初级的写法.难了偶不会.
不过比较简单.
Dim s As String
Dim a As String
Dim i As Integer
Dim j As Integer
For i = 1 To 9 Step 1
s = ""
For j = 1 To i Step 1
a = Str(i) + "*" + Str(j) + "=" + Str(i * j)
s = s + a
Next j
Print s
Next i
不过比较简单.
Dim s As String
Dim a As String
Dim i As Integer
Dim j As Integer
For i = 1 To 9 Step 1
s = ""
For j = 1 To i Step 1
a = Str(i) + "*" + Str(j) + "=" + Str(i * j)
s = s + a
Next j
Print s
Next i