选择结构(分支结构) (Selection Structure) Single Multiple Selection Selection Double selection if-else-if 2021/2/12 else 1656
2021/2/12 16/56 if - else Single Selection Double Selection Multiple Selection if if - else - if 选择结构(分支结构) (Selection Structure)
53关系运算符与关系表达式 Relational Description Examples of Value Operation Expression Less than 6<9 I (true) < Less than or equal to 5<=5 I(true) Greater than 2>6 0(false) Greater than or equal to 9>=5 I(true) Equal to 7=5 0(false) Not equal to 6!=5 I(true) 2021/2/12 17/56
2021/2/12 17/56 5.3关系运算符与关系表达式 Relational Operation Description Examples of Expression Value < Less than 6 < 9 1 (true) <= Less than or equal to 5 <= 5 1 (true) > Greater than 2 > 6 0 (false) >= Greater than or equal to 9 >= 5 1 (true) == Equal to 7 == 5 0 (false) != Not equal to 6 != 5 1 (true)
54朋子单分支控制的条件语命 (Single Selection) Pseudocode structure step a step a if <condition is true> true condition step m start step m step n false step n end if step b step b 2021/2/12 18/56
2021/2/12 18/56 5.4用于单分支控制的条件语句 (Single Selection) Step a condition Step m Step n Step x true false step a condition step m step n step b true false Pseudocode Structure step a if <condition is true> start step m step n end_if step b
扩Seet The structure is表达式非0为真 ection( flowchart Syntax if(expression statement oi if(expression) 复合语句 statement compound statement statement2 被当作一条语句看待 2021/2
2021/2/12 19/56 if Statement The structure is similar to single selection (flowchart) Syntax: if (expression) statement; or if (expression) { statement1; statement2; } 复合语句 compound statement 被当作一条语句看待 表达式非0为真