?? form1.frm
字號(hào):
VERSION 5.00
Begin VB.Form Form1
Caption = "二分迭代法"
ClientHeight = 2070
ClientLeft = 60
ClientTop = 345
ClientWidth = 3465
LinkTopic = "Form1"
ScaleHeight = 2070
ScaleWidth = 3465
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton cmdCalc
Caption = "Command1"
Height = 375
Left = 1560
TabIndex = 1
Top = 1320
Width = 1095
End
Begin VB.TextBox txtRoot
Height = 495
Left = 360
TabIndex = 0
Top = 360
Width = 1935
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub cmdCalc_Click()
Dim x1 As Single, x2 As Single, x3 As Single
x1 = 0
x2 = 2
Do
x3 = (x1 + x2) / 2
If (x1 * x1 * x1 - x1 - 1) * (x3 * x3 * x3 - x3 - 1) > 0 Then
x1 = x3
Else
x2 = x3
End If
Loop Until x2 - x1 < 0.000001
txtRoot.Text = (x1 + x2) / 2
End Sub
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -