VB程序设计多个数相加
展开全部
Private Sub Command1_Click()
Sum = 0: s = ""
Do
x = InputBox("请输入一个数字用于计算" + vbCrLf + "如果输入0,则结束输入", "输入 ", 1)
If x = 0 Then Exit Do
s = IIf(s = "", CStr(x), s & "+" & CStr(x))
Sum = Sum + x
Loop While x <> 0
MsgBox s & "=" & Sum
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询