百钱买百鸡.frm
来自「算法教案」· FRM 代码 · 共 58 行
FRM
58 行
VERSION 5.00
Begin VB.Form Form1
Caption = "百钱买百鸡"
ClientHeight = 4710
ClientLeft = 60
ClientTop = 450
ClientWidth = 5880
LinkTopic = "Form1"
ScaleHeight = 4710
ScaleWidth = 5880
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command1
Caption = "计算"
Height = 495
Left = 4080
TabIndex = 1
Top = 2760
Width = 975
End
Begin VB.ListBox List1
Height = 3660
ItemData = "百钱买百鸡.frx":0000
Left = 240
List = "百钱买百鸡.frx":0002
TabIndex = 0
Top = 480
Width = 3375
End
Begin VB.Label Label1
Height = 735
Left = 3840
TabIndex = 2
Top = 840
Width = 1815
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 sum As Integer
Dim i, a, b, c As Integer
List1.Clear
For a = 0 To 20
For b = 0 To 33
c = 100 - a - b
If a * 5 + b * 3 + c / 3 = 100 Then
List1.AddItem (Str(a) + Str(b) + Str(c))
sum = sum + 1
End If
Next b
Next a
Label1.Caption = "个数:" + Str(sum)
End Sub
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?