帮我编程--VB的

来源:百度知道 编辑:UC知道 时间:2024/05/21 19:36:29
“打印1到100之间3的倍数,每行输出8个”的代码怎么写啊。。。。

急求啊。。。

Private Sub Form_Click()
Counter = 0
strtmp = ""
For i = 1 To 100
If i Mod 3 = 0 Then
strtmp = strtmp + " " + CStr(i)
If Counter < 7 Then
Counter = Counter + 1
Else
Counter = 0
Print strtmp
strtmp = ""
End If
End If
Next
End Sub

Private Sub Command1_Click()
For i = 3 To 100 Step 3
Print Format(i, "@@@");
If i Mod 24 = 0 Then Print
Next
End Sub