用if语句去打这段程序的话应该怎么去打啊??
用if语句去打这段程序的话如何去打啊
2016-02-21
public class HelloWorld {
public static void main(String[] args) {
String today = "三";
String[] str1 = { "一", "三", "五" };
String[] str2 = { "二", "四", "六" };
for (String string : str1) {
if (today.equals(string)) {
System.out.println("吃包子");
}
}
for (String string : str2) {
if (today.equals(string)) {
System.out.println("吃油条");
}
}
if (today.equals("日")) {
System.out.println("吃主席套餐");
}
}
}举报