Private Sub Command1_Click() Dim x As Integer '公鸡数 Dim y As Integer '母鸡数 Dim z As Integer '小鸡数 For x = 0 To 19 For y = 0 To 33 If (100 - x - y) = 3 * (100 - 5 * x - 3 * y) Then z = 100 - x - y Text1.Text = Text1.Text & "公鸡数为:" & x & "母鸡数为:" & y & "小鸡数为:" & z & Chr(13) & Chr(10) End If Next y Next x End Sub