Private Sub cmdjs_Click() Dim x As Integer Dim y As Integer Dim z As Integer
If (txtxj.Text <> "" Or txtgj.Text <> "" Or txtmj.Text <> "") Then txtxj.Text = "" txtgj.Text = "" txtmj.Text = "" For x = 0 To 100 For y = 0 To 100 For z = 0 To 100 If (x + y + z = 100 And (0.5 * x + 2 * y + 3 * z) = 100) Then txtxj.Text = txtxj.Text & x & "," txtgj.Text = txtgj.Text & y & "," txtmj.Text = txtmj.Text & z & "," End If Next z Next y Next x
Else
For x = 0 To 100 For y = 0 To 100 For z = 0 To 100 If (x + y + z = 100 And (0.5 * x + 2 * y + 3 * z) = 100) Then txtxj.Text = txtxj.Text & x & "," txtgj.Text = txtgj.Text & y & "," txtmj.Text = txtmj.Text & z & "," End If Next z Next y Next x
End If
End Sub
Private Sub Form_DblClick() txtxj.Text = "" txtgj.Text = "" txtmj.Text = "" cmdjs.SetFocus End Sub
[此贴子已经被作者于2005-8-4 13:49:25编辑过]