➢形式1:
判1 N
If <判断表达式> Then
判2
[执行语句] [ElseIf <判断表达式> Then
Y
Y
[执行语句] ]...
块1 块2
Else
N
判n
Y
N
块n 块n+1
[执行语句]
End If
现代教育技术中心
例:已知输入某课程的百分
优 mark>=90
制 成 绩 mark , 要 求 显 示 对
Dim other As Integer
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii >= Asc("a") And KeyAscii <= Asc("z") Or
KeyAscii >= Asc("A") And KeyAscii <= Asc("Z") Then
流程图
Dim x As Integer, y As Integer
Dim Max As Integer, Min As Integer
(1) If x > y Then
Max = x: Min = y Else
Max = y: Min = x End If
x>y
Y
N
Max = x Max = y Min = y Min = x
现代教育技术中心
例:输入三个数,输出其中最大值。
Private Sub Command1_Click() Dim a!, b!, c!, max! a = InputBox("请输入第一个数") b = InputBox("请输入第二个数") c = InputBox("请输入第三个数") max = a If b > max Then max = b If c > max Then max = c Print a; ","; b; ","; c; "中最大值是:"; max