vb编程求大神!。
1个回答
展开全部
楼主您好!
答案如下:
1、
Option Explicit
Dim X As Integer, Y As Integer
Dim XY As String
Private Sub Command1_Click()
XY = InputBox("请输入XY的值!", "提示窗口")
X = Val(Mid(XY, 1, 1))
Y = Val(Mid(XY, 2, 1))
MsgBox "X=" & X & ",Y=" & Y & vbCrLf & _
"X+Y=" & X + Y & vbCrLf & _
"X*Y=" & X * Y, 64 + vbOKCancel + vbDefaultButton1,"提示窗口"
End Sub
2、
Option Explicit
Dim a As Double, b As Double, c As Double
Dim s As Double, Area As Double
Private Sub Command1_Click()
a = Val(InputBox("请输入三角形的3条边,这是第1条!", "提示窗口"))
b = Val(InputBox("请输入三角形的3条边,这是第2条!", "提示窗口"))
c = Val(InputBox("请输入三角形的3条边,这是第3条!", "提示窗口"))
s = (a + b + c) / 2
Area = Sqr(s * (s - a) * (s - b) * (s - c))
MsgBox "Area=" & Area, 64 + vbOKCancel + vbDefaultButton1, "提示窗口"
End Sub
3、不知道,没说
望采纳~~~
答案如下:
1、
Option Explicit
Dim X As Integer, Y As Integer
Dim XY As String
Private Sub Command1_Click()
XY = InputBox("请输入XY的值!", "提示窗口")
X = Val(Mid(XY, 1, 1))
Y = Val(Mid(XY, 2, 1))
MsgBox "X=" & X & ",Y=" & Y & vbCrLf & _
"X+Y=" & X + Y & vbCrLf & _
"X*Y=" & X * Y, 64 + vbOKCancel + vbDefaultButton1,"提示窗口"
End Sub
2、
Option Explicit
Dim a As Double, b As Double, c As Double
Dim s As Double, Area As Double
Private Sub Command1_Click()
a = Val(InputBox("请输入三角形的3条边,这是第1条!", "提示窗口"))
b = Val(InputBox("请输入三角形的3条边,这是第2条!", "提示窗口"))
c = Val(InputBox("请输入三角形的3条边,这是第3条!", "提示窗口"))
s = (a + b + c) / 2
Area = Sqr(s * (s - a) * (s - b) * (s - c))
MsgBox "Area=" & Area, 64 + vbOKCancel + vbDefaultButton1, "提示窗口"
End Sub
3、不知道,没说
望采纳~~~
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询