5选择控制结构.pptVIP

  • 6
  • 0
  • 约1.43万字
  • 约 56页
  • 2016-06-18 发布于河南
  • 举报
Important Rule ! switch (expression) { case value1 : statement1; break; case value2 : statement2; break; …… default : statementX; break; } Must be int or char! 5.8用于多路选择的switch语句 注意! Example: switch (month) { case 1: printf(January\n); break; case 2: printf(February\n); break; case 3: printf(March\n); break; default: printf(Others\n); break; } printf(End); Assume month = 1, so … …this step will be executed. Later … …case is terminated here. Jump to … January _ January End _ 5.8用于多路选择的switch语句 Example: switch (mont

文档评论(0)

1亿VIP精品文档

相关文档