第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

請(qǐng)大佬們幫忙看看哪里錯(cuò)了

public class HelloWorld {

? ? public static void main(String[] args) {

int score = 94;

String sex = "女";

? ? ? ? if(score.equals("score>80")){

? ? ? ? ? ? if(sex.equals("男")){

? ? ? ? ? ? ? ? System.out.println("進(jìn)入決賽");

? ? ? ? ? ? }else{

? ? ? ? ? ? ? ? System.oout.println("男子組進(jìn)入決賽");

? ? ? ? ? ? }

? ? ? ? }else{

? ? ? ? ? ? System.out.println("女子組進(jìn)入決賽");

? ? ? ? }else{

? ? ? ? ? ? System.out.println("淘汰");

? ? ? ? }

? ? ? ??


正在回答

3 回答

if(sex.equals("女")){

? ? if(score<94){

? ? ? ? System.out.println("進(jìn)入男子組決賽");

? ? }else{

? ? ? ? System.out.println("進(jìn)入女子組決賽");

? ? }

}else{

? ? System.out.println("進(jìn)入男子組決賽");

}


0 回復(fù) 有任何疑惑可以回復(fù)我~

等于女那里寫錯(cuò)了 應(yīng)該用equals 不是=

0 回復(fù) 有任何疑惑可以回復(fù)我~
  1. System.oout.println("男子組進(jìn)入決賽"); 是out,不是oout;

  2. score.equals("score>80"),數(shù)值比較直接用?score>80,不理解為何要用equals;

  3. 多重if時(shí),后面兩個(gè)else對(duì)一個(gè)if,不能這么寫。下面是我改的,可以參考下。

public class HelloWorld {


public static void main(String[] args) {


int score = 94;


String sex = "女";


? ? ? ? if(score>80){


? ? ? ? ? ? if(sex.equals("男")){


? ? ? ? ? ? ? ? System.out.println("進(jìn)入決賽");


? ? ? ? ? ? ?System.out.println("男子組進(jìn)入決賽");


? ? ? ? ? ? }


? ? ? ? else? {


? ? ? ? ? ? System.out.println("女子組進(jìn)入決賽");


? ? ? ? }}else{


? ? ? ? ? ? System.out.println("淘汰");


? ? ? ? }}}


0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

請(qǐng)大佬們幫忙看看哪里錯(cuò)了

我要回答 關(guān)注問題
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)