Sub calc(ByVal x As Long, ByVal y As Long, ByRef he As Long, ByRef pingfanghe As Long, ByRef lifanghe As Long)
he = x + y
pingfanghe = x ^ 2 + y ^ 2
lifanghe = x ^ 3 + y ^ 3
End Sub
Private Sub Command1_Click()
Dim a As Long, b As Long, x As Long, y As Long, z As Long, s(4) As String
a = InputBox("please enter inter a :", "", 3)
b = InputBox("please enter inter b :", "", 4)
calc a, b, x, y, z
s(0) = "a=" & a
s(1) = "b=" & b
s(2) = "a+b=" & x
s(3) = "a^2+b^2=" & y
s(4) = "a^3+b^3=" & z
MsgBox Join(s, vbCrLf)
End Sub