芮年

    static void Main(string[] args)
        {
            Console.WriteLine("请输入年份");
            int year = Convert.ToInt32(Console.ReadLine());
            if (run(year))
            {

                Console.WriteLine("闰年");
            }
            else 
            {
                Console.WriteLine("不是");
            }
            Console.ReadKey();
           
        }
        static bool run(int year) {
            if (year / 400 == 0 || year % 4 == 0 && year / 100 != 0) { 
                      return true;
            }
            else
            {
                    return false;
            }
          
        }
原文地址:https://www.cnblogs.com/mengluo/p/4788145.html