VB测试题目!请朋友帮忙做哈哦!谢谢...急!

2024-12-26 12:35:01
推荐回答(1个)
回答1:

'一个Command
Private Sub Command1_Click()
Dim i As Long
Dim j As Long
Dim k As Long
Dim nCount As Long
Dim s As String
Me.Cls
Me.AutoRedraw = True
For i = 1 To 3
For j = 1 To 3
For k = 1 To 3
s = s & " " & i & j & k
nCount = nCount + 1
If nCount Mod 5 = 0 Then
Print s
s = ""
End If
Next k
Next j
Next i

If Len(s) > 0 Then
Print s
End If
Print "个数:" & nCount
End Sub