[求助]
百钱买百鸡:公鸡5元一只,母鸡3元一只,小鸡1元3只,100元钱买100只鸡,问公鸡,母鸡,小鸡可各买多少只??
Private Sub Command1_Click()
Dim X, Y, Z As Integer
Text1.Text = ""
For X = 0 To 20
For Y = 0 To 33
For Z = 0 To 300
If 5 * X + 3 * Y + Z / 3 = 100 Then
If X + Y + Z = 100 Then
Text1.Text = Text1.Text & vbCrLf & " 公鸡: " & X & " 母鸡: " & Y & " 小鸡: " & Z & vbCrLf
End If
End If
Next Z
Next Y
Next X
Text1.Text = Text1.Text & vbCrLf & " 计算结束!" & vbCrLf
End Sub