寫了一半看看有沒有錯(cuò)
public class HelloWorld {
? ? public static void main(String[] args) {
int score = 94;
String sex = "女";
? ? ? ? if(score<80){
? ? ? ? ? ? System.out.println("決賽");
? ? ? ? }else if(sex=="男"){
? ? ? ? ? ? System.out.println("男決賽");
? ? ? ? }
? ? ? ??
? ? ? ??
? ? ? ??
? ? ? ??
2017-06-26
你的代碼有誤,你分析一下可以得出,你的不能輸出進(jìn)入某一個(gè)類型的決賽。你應(yīng)該將if判斷的結(jié)構(gòu)邏輯寫完整。
2017-06-26
你這樣看,看起來是不是就清晰了?不過,你代碼打多了就不用這樣也能看出來了