信息技术教学课件设计_2.3-程序的选择结构1.pptVIP

  • 2
  • 0
  • 约2.43千字
  • 约 12页
  • 2021-10-29 发布于湖北
  • 举报

信息技术教学课件设计_2.3-程序的选择结构1.ppt

1.if…Then语句(单分支结构)   语句格式:   (1) If 表达式 Then 语句   (2) If 表达式 Then 语句块    End If   语句功能:当表达式的值为 True或非零时,执行Then后面的语 句(或语句块),否则不做任何操 作,实现单分支选择结构。其流程 如右图。 Private Sub Command1_Click() Dim a As Single, b As Single, c As Single, t As Single a = InputBox(input the first number:) b = InputBox(input the second number:) c = InputBox(input the third number:) Print a, b, c If a b Then t = a a = b b = t End If If a c Then t = a a = c c = t End If If b c Then t = b b = c c = t End If Print a, b, c End Sub 2. If 表达式 Then  语句块1    Else    语句块2   End If  语句功能:当表达式的值

文档评论(0)

1亿VIP精品文档

相关文档