Private Sub Command1_Click()
Dim a As Single
Dim b As Single
Dim min As Single
Dim max As Single
a = Val(InputBox("a="))
b = Val(InputBox("b="))
If a > b Then
max = a
min = b
Else
max = b
min = a
End If
Text1.Text = "从小到大是:" + Str(min) + "," + Str(max)
End Sub Private Sub Command2_Click()
Dim x As Single
Dim y As Single
Dim ch As String
x = InputBox("x=")
y = InputBox("y=")
If Sqr(x ^ 2 + y ^ 2) > 2 Then
ch = "NO"
Else
ch = "YES"
End If
Text2.Text = ch End Sub
Private Sub Command3_Click()
a = InputBox("a=")
If a >= 0 And a < 128 Then
Text3.Text = Chr(a)
Else
Text3.Text = Asc(a)
End If End Sub Private Sub Command4_Click()
Dim x As Single
Dim y As Single
x = InputBox("x=")
If x < 0 Then
y = -x + 1
Else
If x = 0 Then
y = 1
Else
y = x + 1
End If
End If
Text4.Text = Str(y) End Sub Private Sub Command5_Click()
Dim s As Single
Dim x As Single
s = InputBox("s=")
If s < 60 Then
x = "不及格"
Else
If s > 90 Then
x = "优秀"
Else
x = "及格"
End If
End If
Text5.Text = "成绩为" & x End Sub Private Sub Command6_Click()
Dim w As Single
Dim m As Single
w = Val(inpytbox("w="))
If w <= 50 Then
Money = 80 * w
Else
If w < 100 Then
m = 50 * 80 + (w - 50) * 75
Else
m = 50 * 80 + 50 * 75 + (w - 100) * 70
End If
End If
Text6.Text = "运费为:" & Str(m) End Sub Private Sub Command7_Click()
Dim a As Single
Dim b As Single
Dim c As Single
Dim dt As Single
Dim x1 As Single
Dim x2 As Single
a = Val(InputBox("a="))
b = Val(InputBox("b="))
c = Val(InputBox("c="))
dt = b ^ 2 - 4 * a * c
If dt > 0 Then
x1 = Int(100 * ((-b + Sqr(dt)) / (2 * a))) / 100
x2 = Int(100 * ((-b + Sqr(dt)) / (2 * a))) / 100
ch = "x1=" & Str(x1) & "x2=" & Str(x2)
Else
If dt = 0 Then
x1 = Int(100 * (-b / (2 * a))) / 100
ch = "x1=x2=" & Str(x1)
Else
ch = "无实数解"
End If
End If
End If End Sub Private Sub Command8_Click()
Dim a As Single
Dim ch As String
a = Val(InputBox("a="))
If a = 1 Then
ch = "星期一"
End If
If a = 1 Then
ch = "星期一"
End If
a = Val(InputBox("a="))
If a = 1 Then
ch = "星期一"
End If
If a = 1 Then
ch = "星期一"
End If
a = Val(InputBox("a="))
If a = 1 Then
ch = "星期一"
End If
If a = 1 Then
ch = "星期一"
End If
If a = 1 Then
ch = "星期一"
End If
End Sub
Dim a As Single
Dim b As Single
Dim min As Single
Dim max As Single
a = Val(InputBox("a="))
b = Val(InputBox("b="))
If a > b Then
max = a
min = b
Else
max = b
min = a
End If
Text1.Text = "从小到大是:" + Str(min) + "," + Str(max)
End Sub Private Sub Command2_Click()
Dim x As Single
Dim y As Single
Dim ch As String
x = InputBox("x=")
y = InputBox("y=")
If Sqr(x ^ 2 + y ^ 2) > 2 Then
ch = "NO"
Else
ch = "YES"
End If
Text2.Text = ch End Sub
Private Sub Command3_Click()
a = InputBox("a=")
If a >= 0 And a < 128 Then
Text3.Text = Chr(a)
Else
Text3.Text = Asc(a)
End If End Sub Private Sub Command4_Click()
Dim x As Single
Dim y As Single
x = InputBox("x=")
If x < 0 Then
y = -x + 1
Else
If x = 0 Then
y = 1
Else
y = x + 1
End If
End If
Text4.Text = Str(y) End Sub Private Sub Command5_Click()
Dim s As Single
Dim x As Single
s = InputBox("s=")
If s < 60 Then
x = "不及格"
Else
If s > 90 Then
x = "优秀"
Else
x = "及格"
End If
End If
Text5.Text = "成绩为" & x End Sub Private Sub Command6_Click()
Dim w As Single
Dim m As Single
w = Val(inpytbox("w="))
If w <= 50 Then
Money = 80 * w
Else
If w < 100 Then
m = 50 * 80 + (w - 50) * 75
Else
m = 50 * 80 + 50 * 75 + (w - 100) * 70
End If
End If
Text6.Text = "运费为:" & Str(m) End Sub Private Sub Command7_Click()
Dim a As Single
Dim b As Single
Dim c As Single
Dim dt As Single
Dim x1 As Single
Dim x2 As Single
a = Val(InputBox("a="))
b = Val(InputBox("b="))
c = Val(InputBox("c="))
dt = b ^ 2 - 4 * a * c
If dt > 0 Then
x1 = Int(100 * ((-b + Sqr(dt)) / (2 * a))) / 100
x2 = Int(100 * ((-b + Sqr(dt)) / (2 * a))) / 100
ch = "x1=" & Str(x1) & "x2=" & Str(x2)
Else
If dt = 0 Then
x1 = Int(100 * (-b / (2 * a))) / 100
ch = "x1=x2=" & Str(x1)
Else
ch = "无实数解"
End If
End If
End If End Sub Private Sub Command8_Click()
Dim a As Single
Dim ch As String
a = Val(InputBox("a="))
If a = 1 Then
ch = "星期一"
End If
If a = 1 Then
ch = "星期一"
End If
a = Val(InputBox("a="))
If a = 1 Then
ch = "星期一"
End If
If a = 1 Then
ch = "星期一"
End If
a = Val(InputBox("a="))
If a = 1 Then
ch = "星期一"
End If
If a = 1 Then
ch = "星期一"
End If
If a = 1 Then
ch = "星期一"
End If
End Sub