vb求解拜求各位高手
来源:百度知道 编辑:UC知道 时间:2024/09/12 21:48:09
编写一个程序 使用inputbox函数,输入圆半径,并使用print方法在窗体上打印圆的周长和面积
万分感谢
万分感谢
Private Sub Command1_Click()
Dim r!, pi!
pi = 3.1415926
r = Val(InputBox("请输入半径!"))
Print "半径为" & r & "的圆:"
Print "周长为" & 2 * pi * r
Print "面积为" & pi * r * r
End Sub
Dim r As Integer
r = Val(InputBox("半径"))
Print 2 * 3.14159 * r
Print 3.14159 * (r ^ 2)
Private Sub Command1_Click()
a = InputBox("请输入半径")
Print "面积是:" & a * a * 3.14
Print
Print "周长是:" & 2 * a * 3.14
End Sub
Dim r As Long
Private Sub Command1_Click()
r = InputBox("输入半径")
Print "周长: "; 3.1415926 * r * 2
Print "面积: "; 3.1415926 * r * r
End Sub