重新写了一下 求高手解答
2014-10-12
1 回答
public static void main(String[] args) {
String[] today = { "工作日", "周末" };
String[] weater = { "晴朗", "下雨", "多云", "阴天" };
Scanner input1 = new Scanner(System.in);
for (int i = 0; i < today.length; i++) {
System.out.println("请输入今天是什么日子");
String weat = input1.next();
if (weat.equals("周末")) {
for (int j = 0; j < weater.length; j++) {
System.out.println("请输入今天是什么天气");
String day = input1.next();
if (day.equals("晴朗") || day.equals("多云")) {
System.out.println("去室外游乐场玩");
break;
} else if (day.equals("阴天") || day.equals("下雨")) {
System.out.println("去室内游乐场玩");
break;
}
}
break;
} else if (weat.equals("工作日")) {
System.out.println("去上班");
break;
}
}
}
你可以这么去写,你看看有什么不同先
举报