VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   1560
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   3900
   LinkTopic       =   "Form1"
   ScaleHeight     =   1560
   ScaleWidth      =   3900
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton Command1 
      Caption         =   "Command1"
      Height          =   495
      Left            =   1440
      TabIndex        =   0
      Top             =   840
      Width           =   1215
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
    Dim m%, n%, x%, y%
    m = InputBox("输入总头数")
re: n = InputBox("输入总脚数")
    If n Mod 2 <> 0 Then
      MsgBox ("脚数为奇数,重新输入")
      GoTo re
    End If
    If n < 2 * m Then
      MsgBox ("脚数小于头数的倍数,重新输入")
      GoTo re
    End If
    y = n / 2 - m
    x = m - y
    Print "当总头数为:"; m; "总脚数为:"; n
    Print "鸡有："; x; "只 兔有："; y; "只"
End Sub
