//一年有四季;春夏秋冬;试问相应的月份对应的季节怎么用程序表示
public class Month
{
public static void main(String[] args)
{
int mon = 13;
if (mon==3||mon==5||mon==6)
System.out.println(mon+"Spring");
else if (mon==6||mon==7||mon==8)
System.out.println(mon+"summer");
else if (mon==9||mon==10||mon==11)
System.out.println(mon+"autumn");
else if (mon==12||mon==1||mon==2)
System.out.println(mon+"winter");
else
System.out.println(mon+"=Null");
}
}
抛砖引玉;有几种方法能实现!请教...... |