package com.demo;
public class Day301 {
public static void main(String[] args) {
int score=5;
if(score>30){
System.out.println("优秀");
}else if(score>20){
System.out.println("刚刚好");
}else if(score<20){
System.out.println("妈的智障");
}
}
int age=25;
if(age>60){
System.out.println("老年,就该去颐养天年");
}else if(age>40){
System.out.println("中年需要奋斗");
}else if(age>18){
System.out.println("少年,一起去屠龙吧");
}else
System.out.println("童年,活该你无忧无虑,其实我也想回到童年");
}
}
//都是语法书写错误
public class Day301 {
public static void main(String[] args) {
int score=5;
if(score>30)
System.out.println("优秀");
else if(score>20){
System.out.println("刚刚好");
}else if(score<20){
System.out.println("妈的智障");
}else;
int age=25;
if(age>60)
System.out.println("老年,就该去颐养天年");
else if(age>40)
System.out.println("中年需要奋斗");
else if(age>18)
System.out.println("少年,一起去屠龙吧");
else
System.out.println("童年,活该你无忧无虑,其实我也想回到童年");
}
}你把 int age = 25; 上面那个 } 删掉就可以了。 这个是多余的。