代码如下:Private Sub Form_Click()a = Val(InputBox("请输入一个正实数", 16, "4"))If a > 0 Then MsgBox a & "的平方为:" & Format(a ^ 2, "0.000") & Chr(13) & a & "的平方根为:" & Format(a ^ 0.5, "0.000"), 64, "友情提示"Else MsgBox "请输入一个正实数", 16, "友情提示"End IfEnd Sub