m = InputBox("请输入鸡兔总数")
n = InputBox("请输入脚的总数")
a = (4 * m - n) / 2
b = (n - 2 * m) / 2
Print "共有"; a; "只鸡,"; b; "只兔子。"
y = n / 2 - m
If y < 0 Then
MsgBox ("脚数必定>=只数的2倍,请重新输入")
Text2 = ""
Text2.SetFocus
Else
x = m - y
Lable2 = x
Lable3 = y
End If
End If
End Sub
第一题
Private Sub Text2_LostFocus()
Dim m%, n%, y%
m = Val(Text1)
n = Val(Text2)
If n Mod 2 <> 0 Then
MsgBox ("脚数必定为偶数")
Text2 = ""
Text2.SetFocus
Else
自己看一下书就不会了嘛,这又不难! if for while 就那几个语句!求人没用的!
自己看书很容易的,,多给点分,,还行?