public class MySeason {
public static void main(String args[]) {
int month=7;
char season;
if(month==12||month==1||month==2)
season='冬';
else if(month==3||month==4||month==5)
season='春';
else if(month==6||month==7||month==8)
season='夏';
else if(month==9||month==10||month==11)
season='秋';
else{
System.out.println("非月份数据!");
return;
}
System.out.println(month+"月在"+season+"季");
}
}
java入门级代码
最新推荐文章于 2022-12-15 11:39:13 发布