VB程序根据输入的圆半径r求直径周长面积球体积球面积怎么写程序?
2个回答
展开全部
Option Explicit
Const pi = 3.141592654
Private Sub Form_Load()
Me.AutoRedraw = True
Dim r As Double
r = Val(InputBox("输入半径"))
Print "直径:" & 2 * r
Print "周长:" & 2 * r * pi
Print "圆面积: " & r * r * pi
Print "球面积: " & 4 * r * r * r * pi / 3
Print "球体积: " & 4 * r * r * pi
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询