现象:
循环时间段根据月份循环
方法:
代码:
public static void StrsuSwitch11() {
int startNum=201912+9;
int lastNum=202112+6;
for (int ym=startNum;ym<=lastNum;ym++){
int year=ym/12;
int month=ym%12;
if(month==0){
year=year-1;
month=12;
}
System.out.println(“当前年:”+year+“月:”+month);
}
}