C#判断闰年平年

来源:互联网 发布:万网个人域名icp备案 编辑:程序博客网 时间:2024/04/29 03:15
 static void Main(string[] args)   {      Console.Write("请输入一个年份:");      string s = Console.ReadLine();      int x = int.Parse(s);      if ((x % 4 == 0 && x % 100 != 0) || x % 400 == 0)         Console.WriteLine("{0}是闰年", x);      else         Console.WriteLine("{0}不是闰年", x);      Console.ReadKey(false);     }  

原创粉丝点击