📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "常用算法"
ClientHeight = 5850
ClientLeft = 60
ClientTop = 345
ClientWidth = 5745
LinkTopic = "Form1"
ScaleHeight = 5850
ScaleWidth = 5745
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command2
Caption = "方法二"
Height = 495
Left = 3720
TabIndex = 1
Top = 240
Width = 1455
End
Begin VB.CommandButton Command1
Caption = "方法一"
Height = 495
Left = 600
TabIndex = 0
Top = 240
Width = 1215
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'CODE Manger By BcodeXRose
'******************************************************************
'************** 过程名称:Command1_Click
'************** 参数: 无
'******************************************************************
Private Sub Command1_Click()
Dim x%, y&, z!
t1 = Time
For x = 0 To 100
For y = 0 To 100
For z = 0 To 100
If x + y + z = 100 And 3 * x + 2 * y + 0.5 * z = 100 Then
Print x, y, z
End If
Next z
Next y
Next x
t2 = Time
Print "方法一化去"; DateDiff("s", t1, t2); "秒时间"
End Sub
'******************************************************************
'************** 过程名称:Command2_Click
'************** 参数: 无
'******************************************************************
Private Sub Command2_Click()
Dim x%, y&, z!
t1 = Time
For x = 0 To 33
For y = 0 To 50
If 3 * x + 2 * y + 0.5 * z = 100 Then
Print x, y, 100 - x - y
End If
Next y
Next x
t2 = Time
Print "方法二化去"; DateDiff("s", t1, t2); "秒时间"
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -