闰年: (year%4==0 && year%100!=0)||(year%400==0), 二月有29天
static void Func()
{
int days = 0;
Console.Write("输入年份:");
int year = Convert.ToInt32(Console.ReadLine());
Console.Write("输入月份:");
int mon = Convert.ToInt32(Console.ReadLine());
bool isR = (year % 4 == 0 && year % 100 != 0) || (year % 400 == 0);
if (isR&&mon==2)
{
days = 29;
} else if (mon==2)
{
days = 28;
}
else if (mon == 4 || mon == 6 || mon == 9 || mon == 11) days = 30;
else days = 31;
Console.WriteLine("{0}年{1}月有{2}天", year, mon, days);
}