用vb6.0做求圆的周长和面积的程序代码
发布网友
发布时间:2022-06-02 20:34
我来回答
共1个回答
热心网友
时间:2024-12-04 13:51
Private Sub Command1_Click()
Const PI = 3.1415926
Dim R As Integer, Area As Double, Perimeter As Double
R = Val(Text1.Text) ’不是Test1.Test
Area = PI * R * R
Perimeter = 2 * PI * R
Label1.Caption = R & " - --" & Area & " - --" & Perimeter
'或者 Label1.Caption = Cstr(R) & " - --" & Cstr(Area) & " - --" & Cstr(Perimeter)
End Sub
Private Sub Command2_Click()
Text1.Text = ""
Label1.Caption = ""
End Sub
Private Sub Command3_Click()
End
End Sub这里面还有就是求直径。