Dim i, j, k, c
For i = 0 To 10
For j = 0 To 10 - i
For k = 0 To 10 - 2 * j - i
If i + 2 * j + 5 * k = 10 Then
Debug.Print i & "张1角 + " & j & "张2角 + " & k & "张5角=1元"
End If
Next k
Next j
Next i
'本例循环161次,楼上循环198次且语法错误
Dim i, j, k, c
For i = 0 To 10
For j = 0 To 10 - i
For k = 0 To 10 - 2 * j - i
If i + 2 * j + 5 * k = 10 Then
Debug.Print i & "张1角 + " & j & "张2角 + " & k & "张5角=1元"
End If
Next k
Next j
Next i
'本例循环161次,楼上循环198次且语法错误