Console.Write("请输入一个年份:");
string y = Console.ReadLine();
int year = Convert.ToInt32(y);
if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0)
{
Console.WriteLine("是闰年");
}
else
{
Console.WriteLine("不是闰年");
}
Console.ReadKey();
这是数学问题,不是程序问题。