1、if语句
if(condition)
statement1
else
statement2
case A1:
statement1
case A2:
statement2
...
default:
statementn
statement
statement
statement
2、switch语句
switch(表达式)
{
}
表达式必须产生一个整数结果,其值与每个case的值比较。每个case标号的值都必须是一个整型常量表达式。
对于switch结果,只能在它的最好一个case标号或default标号后面定义变量。
3、while语句
while(condition)
4、for循环语句
for(initializer; condition;表达式)
5、do while语句
do
while(condition);
do while语句总是以分号结束。
6、break语句
break语句用于结束最近的while、do while、for或switch语句。