下面这段代码敲了好几遍。输出都是为90。
当时懵逼了。找问题所在。删了从敲,敲了还是一样,脑子陷进死循环。
后来才发现是输出的地方错了。应该输出 type。
再次警示下下自己。
public class bdlx01 {
public static void main(String[] args) {
int score = 90;
String type = score<60?"不及格":"及格";
System.out.println(score);
}
}
下面这段代码敲了好几遍。输出都是为90。
当时懵逼了。找问题所在。删了从敲,敲了还是一样,脑子陷进死循环。
后来才发现是输出的地方错了。应该输出 type。
再次警示下下自己。
public class bdlx01 {
public static void main(String[] args) {
int score = 90;
String type = score<60?"不及格":"及格";
System.out.println(score);
}
}