int x = 0;// 1 2 3 4 5 6 7
System.out.print("输入x:");
x = Integer.parseInt(scan.nextLine());
//if 单分支
/* if(条件){ //根据()中整体式子的值 true false
条件成立 才执行的代码
}
*
* */
//if 双分支
/* if(条件){
条件成立 才执行的代码
}else{
条件不成立 才执行的代码
}
*
* */
//if 多分支
/* if(条件1){
条件成立1 才执行的代码
}else if(条件2){
前面条件不成立 且条件2成立 才执行的代码
}else if(条件3){
前面条件不成立 且条件3成立 才执行的代码
}else{
前面条件都不成立才执行的代码
}
*
* */
// if (x>=1 && x<=5) {
// System.out.println("上班");
//
// }else if(x==6 || x==7){
// System.out.println("睡懒觉");
//
// }else{
// System.out.println("输入错误");
// }
//
// System.out.println("----the end----");
//练习: 输入成绩 打等地 A B C D
if (x>=90) {
}else if (x>=80) {
}else if(x>70) {
}else if(x>60) {
}else if(x>50) {
}else if(x>40) {
}
}
}
System.out.print("输入x:");
x = Integer.parseInt(scan.nextLine());
//if 单分支
/* if(条件){ //根据()中整体式子的值 true false
条件成立 才执行的代码
}
*
* */
//if 双分支
/* if(条件){
条件成立 才执行的代码
}else{
条件不成立 才执行的代码
}
*
* */
//if 多分支
/* if(条件1){
条件成立1 才执行的代码
}else if(条件2){
前面条件不成立 且条件2成立 才执行的代码
}else if(条件3){
前面条件不成立 且条件3成立 才执行的代码
}else{
前面条件都不成立才执行的代码
}
*
* */
// if (x>=1 && x<=5) {
// System.out.println("上班");
//
// }else if(x==6 || x==7){
// System.out.println("睡懒觉");
//
// }else{
// System.out.println("输入错误");
// }
//
// System.out.println("----the end----");
//练习: 输入成绩 打等地 A B C D
if (x>=90) {
}else if (x>=80) {
}else if(x>70) {
}else if(x>60) {
}else if(x>50) {
}else if(x>40) {
}
}
}