刚写的,测试了一下,这个应该可以 Private Sub Form_click() Cls For i = 1 To 8 For j = 2 To 9 If j > i Then For k = 3 To 10 If k > j Then Print i; j; k; Print End If Next k End If Next j Next i End Sub
Private Sub Form_click() Open "D:\123.txt" For Output As #1 For i = 1 To 8 For j = 2 To 9 If j > i Then For k = 3 To 10 If k > j Then Print #1, i; j; k End If Next k End If Next j Next i Close #1 End Sub 黑体字是新增加的... 还有刚才的 If k > j Then Print i; j; k; Print End If 可以把 k 后面的";"去掉,同时去掉下一行的print,效果是一样的