try判断是不是闰年try-catch

using System;
using System.Collections.Generic;
using System.Text;

namespace ConsoleApplication8
{
    class Program
    {
        static void Main(string[] args)
        {
            while (true)
            {
                string rn = Console.ReadLine();
                string s = "";
                try
                {
                    DateTime rn1 = Convert.ToDateTime(rn + "-2-29");系统自动判断,根据系统时间
                    s = "年是闰年";
                }
                catch (Exception)
                {
                    s = "年不是闰年";
                }
                finally
                {
                    Console.WriteLine(rn+s);
                }
            }
        }
    }
}
二百个不间断的重复,只是让我看到了人的命运无法改变这一事实而已。
原文地址:https://www.cnblogs.com/dlexia/p/4389060.html