Dim x As Double
Dim y1 As Double
Dim y2 As Double
Dim y3 As Double
Dim y4 As Double
If Not IsNumeric(Text1.Text) Then
MsgBox "请正确输入如早逗睁袜一个渣卖数字!"
Exit Sub
End If
x = Val(Text1.Text)
y1 = x ^ 2
y2 = x ^ (1 / 2)
y3 = x ^ 3
y4 = x ^ (1 / 3)
Label1.Caption = ""
Label1.Caption = Label1.Caption &Format(y1, "#.0000")
Label1.Caption = Label1.Caption &vbCrLf &Format(y2, "#.0000")
Label1.Caption = Label1.Caption &vbCrLf &Format(y3, "#.0000")
Label1.Caption = Label1.Caption &vbCrLf &Format(y4, "#.0000")
End Sub
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)