//伪代码
if (关系表达式)
代码块
//伪代码
if (关系表达式)
代码块1
else
代码块2
//伪代码
if (关系表达式1)
代码块1
else if(关系表达式2)
代码块2
else
代码块3
if (score >= 90)
System.out.println("A");
else if (score >= 80)
System.out.println("B");
else if (score >= 60)
System.out.println("C");
else
System.out.println("Fail");
switch (表达式) {
case val0:
break;
case val1:
break;
...
case valN:
break;
default:
break;
}
switch (score/10) {
case 7:
case 8:
System.out.println("B");
break;
case 9:
System.out.println("A");
break;
case 6:
System.out.println("C");
break;
default:
System.out.println("D");
break;
}
switch (day) {
case 1:
case 2:
case 3:
case 4:
case 5:
System.out.println("Workday");
break;
case 6:
case 7:
System.out.println("Restday");
break;
default:
System.out.println("Wrongday");
break;
}
for( 初始化循环语句; 循环判断语句; 循环迭代语句){
循环体语句;
}
for (int i = 0; i <= 100; i++) {
if (i % 2 == 0) {
System.out.println(i);
}
}
while( 循环条件语句){
循环体语句;
}
do{
循环体语句;
}while( 循环条件语句);