Private Sub Command1_Click()
Dim value, inc As Double
Dim i As Integer
value = 1 '某年森链产值,设为1,可以改
i = 0
inc = Val(InputBox("输入增长目标(倍数),一定要输入数字!!!!别吃饱此碧孙了慧顷撑的,乱输入", "增长计算"))
'输入增长幅度,是倍 数,输入100,就是要增长到100倍.
inc = inc * value
While value <inc '当不满足循环条件时,刚好是达到或超过了目标.
value = value * 1.1
i = i + 1
Wend
MsgBox "要" &Str(i ) &"年才能实现"
End Sub
Private Sub Command1_Click()Dim Count As Double, r As Double, n As Integer
毕迅拿 Count = 13
r = 0.008
Do While Count < 26
n 昌裂= n + 1
Count = Count * (1 + r)
Loop
MsgBox "我国现有手搭人口 13 亿,按照每年 0.8% 的增长率," & vbCrLf & n & " 年后,我国的人数超过 26 亿!"
End Sub
Private Sub CommandButton1_Click()y = 1
Do While 13 * (1 + 0.01) ^ y <= 20
y = y + 1
Loop
Year = y - 1
Print Year
End Sub
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)