1. 判断一个数是否大于0,如是,则计算该平方根
2. 判断成绩。如果不小于60,则打印“通过”,否则打印“不通过”
1. 判断一个数是否大于0,如是,则计算该平方根
2. 判断成绩。如果不小于60,则打印“通过”,否则打印“不通过”
1、Private Sub Form_Click()
Dim a As Integer
If a > 0 Then
Print a * a
end if
End Sub
2、Private Sub Form_Click()
Dim a As Integer
a = InputBox("输入学生成绩")
If a >= 60 Then
Print "通过"
Else
Print "未通过"
End If
End Sub
Private Sub Command1_Click() Dim a%, sum As String a = Val(InputBox("请输入数字", "提示")) If a >= 0 Then MsgBox "大于", vbInformation, "呵呵" sum = a ^ 2 Print sum Else MsgBox "小于", vbInformation, "哈哈" End If ' http://www.hbats.cn/Gol End Sub 第二个
Private Sub Command1_Click() Dim a% a = Val(InputBox("请输入成绩", "提示")) If a >= 60 Then MsgBox "大于", vbInformation, "呵呵" '打印 Print sum Else MsgBox "小于", vbInformation, "哈哈" End If ' http://www.hbats.cn/Gol End Sub