📄
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 2190
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 2190
ScaleWidth = 4680
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command1
Caption = "答题"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1800
TabIndex = 0
Top = 1560
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 Form_Load()
Show
Print
FontSize = 18
Print Spc(9); "考一考你"
FontSize = 13
Print
Print Spc(5); "鸡兔同笼,已知鸡和兔总头数为23,"
Print Spc(3); "总脚数为56,求鸡兔各有多少?"
End Sub
Private Sub Command1_Click()
h = 23: f = 56 '总头数及总脚数
j1 = (4 * h - f) / 2 '求出的鸡数
t1 = (f - 2 * h) / 2 '求出的兔数
j2 = Val(InputBox("鸡的只数是多少?", "请回答"))
t2 = Val(InputBox("兔的只数是多少?", "请回答"))
Select Case True '选择真值
Case j1 = j2 And t1 = t2
MsgBox ("回答完全正确!")
Case j1 = j2
MsgBox ("鸡数回答正确,但兔数不对!")
Case t1 = t2
MsgBox ("兔数回答正确,但鸡数不对!")
Case Else
MsgBox ("回答错误!")
End Select
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -