public static void main(String[] args) { ("输入年份:"); Scanner s = new Scanner();//键盘扫描器 int year = (); ("输入月份"); int month = (); switch (month){ case 1: case 3: case 5: case 7: case 8: case 10: case 12: (year+"年"+month+"月份共:"+31+"天"); break; case 2:if (year%400==0||(year%4==0&&year%100!=0))//二月判别器 { (year+"年"+month+"月份共:"+29+"天"); }else { (year+"年"+month+"月份共:"+28+"天"); } break; case 4: case 6: case 9: case 11: (year+"年"+month+"月份共:"+30+"天"); break; } }