这样写没问题吧
public class HelloWorld {
public static void main(String[] args) {
int age=70;
String age1;
if(age>60){
age1 ="老年";
}else if(age>40){
age1 ="中年";
}else if(age>18){
age1 ="少年";
}else{
age1 ="童年";
}
System.out.println(age1);
}
}
public class HelloWorld {
public static void main(String[] args) {
int age=70;
String age1;
if(age>60){
age1 ="老年";
}else if(age>40){
age1 ="中年";
}else if(age>18){
age1 ="少年";
}else{
age1 ="童年";
}
System.out.println(age1);
}
}
2020-04-07
举报