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

📄 form1.frm

📁 vb 的例子
💻 FRM
字号:
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

⌨️ 快捷键说明

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