已采纳回答 / 瓜皮瓜皮
public class HelloWorld{ public static void main(String[] args) {int age1=24;int age2=18;int age3=36;int age4=27;int sum=age1+age2+age3+age4;int avg=(age1+age2+age3+age4)/4;int minus=(age1-age2);int newAge=age1--;System.out.println("年龄总和:"+s...
2021-06-02
if(age>=60){
System.out.println("老年");
}else if(age>=40){
System.out.println("中年");
}else if(age>18){
System.out.println("少年");
}else if(age<=18){
System.out.println("童年");
}
System.out.println("老年");
}else if(age>=40){
System.out.println("中年");
}else if(age>18){
System.out.println("少年");
}else if(age<=18){
System.out.println("童年");
}
2021-06-02
public class HelloWorld{
public static void main(String[] args) {
final int AGE = 18;
final char MAN='男';
final char WOMAN='女';
System.out.println(AGE);
System.out.println(MAN);
System.out.println(WOMAN);
}
}
public static void main(String[] args) {
final int AGE = 18;
final char MAN='男';
final char WOMAN='女';
System.out.println(AGE);
System.out.println(MAN);
System.out.println(WOMAN);
}
}
2021-05-30