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

📄 decisiontree.frm

📁 解决一系列运筹学问题 运用到了递归方面的知识 适合新手使用
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   3090
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   ScaleHeight     =   3090
   ScaleWidth      =   4680
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton Command1 
      Caption         =   "ComputeResult"
      Height          =   495
      Left            =   1680
      TabIndex        =   0
      Top             =   2280
      Width           =   1575
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Function Dev(drop As Single, ave As Single, rise As Single) As Single
Dev = drop * 0.1 + ave * 0.5 + rise * 0.4
End Function

Private Sub Command1_Click()
Dim drop As Single, ave As Single, rise As Single
Dim x(1 To 5) As Integer
For i = 1 To 5
drop = Val(InputBox("Enter the number of drop price: "))
ave = Val(InputBox("Enter the number of average price: "))
rise = Val(InputBox("Enter the number of rising price: "))
x(i) = Dev(drop, ave, rise)
Next i

If x(1) > x(2) Then
e4 = x(1)
Else
e4 = x(2)
End If
If x(3) > x(4) Then
e6 = x(3)
Else
e6 = x(4)
End If
e2 = e4 * 0.6 + x(5) * 0.4
e3 = e6 * 0.8 + x(5) * 0.2
If e2 > e3 Then
Print "the best solution is to develop by self "
Else
Print "the best solution is to purchase patent "
End If

End Sub

⌨️ 快捷键说明

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