import java.util.Scanner;
public class Main {
//判断给定的年份是否为闰年,true:闰年;false:平年
//判断方法:闰年年份需满足:能被4整除且能被100整除||能被400整除
public boolean isLeapYear(int year){
return ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0));
}
//根据指定年份和月份求出该月份的天数
public int getMonthDay(int year,int month){
int total = 0;
switch(month){
case 1: total = 31;break;
case 3: total = 31;break;
case 5: total = 31;break;
case 7: total = 31;break;
case 8: total = 31;break;
case 10: total = 31;break;
case 12: total = 31;break;
case 4: total = 30;break;
case 6: total = 30;break;
case 9: total = 30;break;
case 11: total = 30;break;
case 2: if(isLeapYear(year))//2月单独进行判断
{total = 29;}
else
{total = 28;}
break;
}
return total;
}
//判断某一年第一天星期几
public int getFirtdayOfYear(int year) {
int total = 0;
int YearDay = 0;
for(int i=1;i