import java.util.*;public class Aaa {? ? public static void main(String[] args) { Scanner in=new Scanner(System.in); System.out.println("輸入成績");? ? int score = in.nextInt();? ? System.out.println("輸入性別'男'或'女'"); String sex = in.next();? ? ? ? if (score>80){? ? ? ? if (sex.equals("女"))? ? ? ? {? ? ? ? ? System.out.println("女子組決賽");?? ? ? ? }? ? ? ? else{? ? ? ? ? System.out.println("男子組決賽");?? ? ? ? }? ? ? ? }? ? ? ? else{ System.out.println("淘汰");}? ? ? ? }
3 回答
已采納

努力提升
TA貢獻65條經(jīng)驗 獲得超15個贊
提示你輸入性別才是對的啊,因為你寫的
System.out.println("輸入成績");???? int?score?=?in.nextInt(); ???? System.out.println("輸入性別'男'或'女'"); String?sex?=?in.next();
執(zhí)行完這個以后才會進行判斷啊,你不輸入性別怎么進行
if (sex.equals("女"))這一句的判斷呢
添加回答
舉報
0/150
提交
取消