[经济学]Lecture 8 Control Structure3 Repetition Structures1 of 2.pptVIP

  • 0
  • 0
  • 约8.6千字
  • 约 44页
  • 2018-02-15 发布于浙江
  • 举报

[经济学]Lecture 8 Control Structure3 Repetition Structures1 of 2.ppt

[经济学]Lecture 8 Control Structure3 Repetition Structures1 of 2

Dept.of Computer Sci. Tech.,YBU while和do-while的等价性 do-while 语句 while 计算E E?0? Yes No 执行S 计算E E?0? 执行S Yes No 计算E E?0? Yes No do-while * if Dept.of Computer Sci. Tech.,YBU 循环结构的特征 goto 语句 while 语句 do-while 语句 for语句 【重点】语句执行过程 【难点】循环三要素 循环的嵌套 break continue语句 第5章 循环结构(1/2) * Dept.of Computer Sci. Tech.,YBU 语句格式 其中 E1,E2,E3为表达式,E2为循环条件(E2非0,循环条件成立;E2等于0, 循环条件不成立) S为一条语句,称为循环体,如果每次循环需要执行多条语句,需用复合语句替代S for结构在语法上是一条语句 for 语句 for (E1; E2; E3) S * Dept.of Computer Sci. Tech.,YBU 执行过程 for 语句 S的下一条语句 for (E1; E2; E3) S E2!=0 E2==0 1 2 3 4 2 5 计算E2 E2?0? 计算E1 Yes No 执行S的下一条语句 执行S 计算E3 * Dept.o

文档评论(0)

1亿VIP精品文档

相关文档