5.8用于多路选择的switch语句 The structure is similar to multiple selection (flowchart) switch (expression) { case value1 : statement1; break; case value2 : statement2; break; …… default : statementX; break; } Don’t forget the braces !! Don’t forget the colons !! Don’t forget the blank !! 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: pri
原创力文档

文档评论(0)