首页 > 电脑

VB程序输入半径求周长面积和体积?用(function)函数

更新时间2019-08-11 05:03:37

程序参考

Private Function fun(r As Double, ByRef s As Double)
fun = (4# / 3#) * 3.14 * r ^ 3
s = 4# * 3.14 * r ^ 2
End Function

Private Sub Command1_Click()
 Dim r As Double, s As Double, v As Double
 r = InputBox("输入半径")
 v = fun(r, s)
 Print "s=", s
 Print "v=", v
 
 
End Sub


上一篇:这个c++语言哪错了?

下一篇:excel计算值在某个范围值里面就显示相应的设定值