Scanner str = new Scanner(System.in);
System.out.print("请输入年份:");
int Year = str.nextInt();
System.out.print("请输入月份:");
int Month = str.nextInt();
System.out.print("请输入天:");
int Day = str.nextInt();
switch (Month-1) {
case 11:Day+=30;;
case 10:Day += 31;
case 9:Day += 30;
case 8:Day += 31;
case 7:Day += 31;
case 6:Day += 30;
case 5:Day += 31;
case 4:Day += 30;
case 3:Day += 31;
case 2:Day += (Year%4==0&&Year%100!=0||Year%400==0)?29:28;
case 1:Day += 31;
case 0:break;
default:System.out.print("输入有误!");
}
System.out.print("该天是当年的第" + Day + "天");