vb中圆周率的函数是?

2025-01-02 14:16:54
推荐回答(4个)
回答1:

没有现成的!
你可以这样:
Dim pi as double, s as double,r as double
pi=3.1415926535
r=1.2
s=pi*r^2
print "s=" & s

回答2:

r^2*3.1415926
就行了,这个不用函数。

回答3:

vb6.0没有定义π的常量,当可以通过atn函数求的π的值π=4*atn(1)
Private Sub Command1_Click()
Dim r As Double, s As Double, π As Double
r = Val(InputBox("请你输入半径R"))
π = 4 * Atn(1)
s = π * r ^ 2
MsgBox "圆的面积为:" & s
End Sub

回答4:

看看这个可以不!