入年:"); year=fymd.input(); System.out.print("输入月:"); month=fymd.input(); System.out.print("输入天:"); day=fymd.input(); if(year<0||month<0||month>12||day<0||day>31){ System.out.println("输入错误,请重新输入!"); e=1; } }while(e==1); for(inti=1;i<month;i++){ switch(i){ case1: case3: case5: case7: case8: case10: case12: days=31; break; case4: case6: case9: case11: days=30; break; case2: if((year%400==0)||(year%4==0&&year%100!=0)){ days=29; }else{ days=28; } break; } d+=days; } System.out.println(year+"-"+month+"-"+day+"是这年的第"+(d+day)+"天。");}}classinput{publicintinput(){ intvalue=0; Scanners=newScanner(System.in); value=s.nextInt(); returnvalue;}}