zoukankan      html  css  js  c++  java
  • 判断一年是否为闰年

            static void Main(string[] args)
            {
                while (true)
                { 
                    Console.WriteLine("请输入您的年份");
                    int x = Convert.ToInt32(Console.ReadLine());
                    try
                    {
                      DateTime y = Convert.ToDateTime(x+"-2-29");   //只要年份有2月29就是闰年
                      Console.WriteLine("是闰年");

                    }
                    catch (Exception)
                    {
                        Console.WriteLine("不是闰年");
                      
                    }
                    Console.ReadLine();

  • 相关阅读:
    hbase过滤器(1)
    公司jar包提交到集群的方法
    hbase Hfile处理原因
    oracle pl/sql远程连接过程
    mapreduce join操作
    HTML不熟悉方法总结
    Ajax详解
    getElementById和querySelector区别
    Session
    ES6模块化
  • 原文地址:https://www.cnblogs.com/lk-kk/p/4388119.html
Copyright © 2011-2022 走看看