|
// Java多分支成绩分级,注意判断条件的顺序
|
|
package xiangmu;
|
|
|
|
public class Ceshi {
|
|
public static void main(String args[]) {
|
|
int chengji = 85;
|
|
if(chengji == 100) {
|
|
dayin("满分");
|
|
}else if(chengji >= 80) {
|
|
dayin("优秀");
|
|
}else if(chengji >= 60) {
|
|
dayin("及格");
|
|
}else {
|
|
dayin("不及格");
|
|
}
|
|
}
|
|
public static void dayin(String zifuchuan) {
|
|
System.out.println(zifuchuan);
|
|
}
|
|
}
|