📄 例13.frm
字号:
VERSION 5.00
Begin VB.Form FRM5_4_5
BackColor = &H00C0FFFF&
Caption = "5-4-5:人口预测"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 7095
BeginProperty Font
Name = "宋体"
Size = 18
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
LinkTopic = "Form1"
ScaleHeight = 3195
ScaleWidth = 7095
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command1
Caption = "计算"
Height = 495
Left = 2760
TabIndex = 1
Top = 1800
Width = 1335
End
Begin VB.Label Label1
BackColor = &H0000FF00&
Caption = "世界上现有人口60亿,如果以每年1.4%的速度增长,多少年后世界人口达到或超过70亿?"
Height = 855
Left = 120
TabIndex = 0
Top = 360
Width = 6855
End
End
Attribute VB_Name = "FRM5_4_5"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim p As Double
Dim r As Single
Dim n As Integer
p = 6000000000#
r = 0.014
n = 0
Do Until p >= 7000000000#
p = p * (1 + r)
n = n + 1
Loop
MsgBox (Str(n) & "年后;世界人口达到" & Str(p))
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -