Sub 计算符合要求的数字组合()
Dim a, b, c, d
d = 1
b = 1
c = 1
a = 1
Do Until a * Cells(1, 1) + b * Cells(1, 2) + c * Cells(1, 3) > Cells(1, 5)
Do Until a * Cells(1, 1) + b * Cells(1, 2) + c * Cells(1, 3) > Cells(1, 5)
Do Until a * Cells(1, 1) + b * Cells(1, 2) + c * Cells(1, 3) > Cells(1, 5)
If a * Cells(1, 1) + b * Cells(1, 2) + c * Cells(1, 3) = Cells(1, 5) Then
Cells(d, 7) = a
Cells(d, 8) = b
Cells(d, 9) = c
d = d + 1
Else
End If
c = c + 1
Loop
c = 1
b = b + 1
Loop
b = 1
a = a + 1
Loop
End Sub