⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 装箱改进方案.frm

📁 算法教案
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "变形金刚箱方案(2)"
   ClientHeight    =   3960
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   5940
   LinkTopic       =   "Form1"
   ScaleHeight     =   3960
   ScaleWidth      =   5940
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton Command1 
      Caption         =   "计算"
      Height          =   375
      Left            =   3720
      TabIndex        =   5
      Top             =   3000
      Width           =   1095
   End
   Begin VB.TextBox Text2 
      Height          =   375
      Left            =   3720
      Locked          =   -1  'True
      TabIndex        =   4
      Top             =   2280
      Width           =   1095
   End
   Begin VB.TextBox Text1 
      Height          =   375
      Left            =   3720
      TabIndex        =   2
      Top             =   960
      Width           =   1095
   End
   Begin VB.ListBox List1 
      Height          =   2940
      ItemData        =   "装箱改进方案.frx":0000
      Left            =   240
      List            =   "装箱改进方案.frx":0002
      TabIndex        =   0
      Top             =   360
      Width           =   3135
   End
   Begin VB.Label Label2 
      Caption         =   "方案数"
      Height          =   255
      Left            =   3720
      TabIndex        =   3
      Top             =   1680
      Width           =   1095
   End
   Begin VB.Label Label1 
      Caption         =   "最大盒数"
      Height          =   375
      Left            =   3840
      TabIndex        =   1
      Top             =   360
      Width           =   855
   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 x, y, z, c, max As Integer
    c = 0
    max = Val(Text1.Text)
    If max <= 0 Then
        List1.AddItem "输入的总盒数有误,请重新输入"
    Else
      List1.Clear
      List1.AddItem "--总盒数不超过" + Str(max) + "的方案--"
      For x = 1 To 293
         For y = 1 To 118
             For z = 1 To 74
                If 2 * x + 5 * y + 8 * z = 600 And x + y + z <= max Then
                    List1.AddItem Str(x) + " " + Str(y) + " " + Str(z)
                    c = c + 1
                End If
             Next z
         Next y
      Next x
      Text2.Text = Str(c)
    End If
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -