#代码Console.WriteLine("请输入年份"); string str_year = Console.ReadLine(); int year = Convert.ToInt32(str_year); bool b =year % 400 ==0 || (year % 4 ==0 && year % 100 !=0); Console.WriteLine("你输入的年份是:{0},此年份是不是闰年{1}",year,b); Console.ReadKey();#效果 图片发自简书App