VB题目..貌似明天就要模块考试了..啥都不会..老师就给道例题..

2024-12-28 12:12:54
推荐回答(4个)
回答1:

好好学习,天天向上,你要对得起你们父母。。。。。。;;。

Private Sub Command1_Click()
Dim i As Integer
Dim j As Integer
Dim sTmp As String
Dim sOut As String
For i = 1 To 9
sTmp = ""
For j = 1 To i
sTmp = sTmp & " " & CStr(j) & " * " & CStr(i) & " = " & CStr(i * j)
Next j
sOut = sOut & sTmp & vbCrLf
Next i
Print sOut
End Sub

回答2:

Private Sub Form_Click()
Dim A As Integer
Dim B As Integer
Dim Count As Integer
Count = 1

For A = 1 To 9
For B = 1 To A

If Count <> A Then
Print Chr(10) & Chr(13)
Count = A
End If

Print B & "×" & A & "="; A * B & Space(3);

Next B
Next A
End Sub

试试这个吧~运行时窗体拉大一点再Click哈~不然显示不完全~ ^ ^

不过你要加油咯~这是你的课程,怎么能这样对待哩?

回答3:

没那么难吧``

回答4:

加油咯...99乘法表应该你们老师讲循环嵌套的时候就说了吧...
哎....
Dim i%, j%
For i = 1 To 9
For j = 1 To i
Print i & "×" & j & "=" & i * j & vbTab;
Next j
Print
Next i