為什么兩個小程序就會在第二個int出錯呢
package com.demo;
public class Day301 {
public static void main(String[] args) {
int score=5;
if(score>30){
? ?System.out.println("優(yōu)秀");
}else if(score>20){
? ?System.out.println("剛剛好");
}else if(score<20){
? ? ? ?System.out.println("媽的智障");
? ?}
}
? ? ? ? int age=25;
if(age>60){
? ?System.out.println("老年,就該去頤養(yǎng)天年");
}else if(age>40){
? ?System.out.println("中年需要奮斗");
? }else if(age>18){
? ? ? ?System.out.println("少年,一起去屠龍吧");
? ?}else?
? ? ? ?System.out.println("童年,活該你無憂無慮,其實我也想回到童年");
?
}
}
? ?
2017-09-22
2017-09-20
你把 int age = 25; 上面那個 } 刪掉就可以了。? 這個是多余的。