首页 > 其他 > 详细

判断闰年

时间:2014-09-09 18:22:49      阅读:253      评论:0      收藏:0      [点我收藏+]
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace runnian
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.Write("输入年 如2008:  ");
            string s = Console.ReadLine().ToUpper();
            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.ReadLine();
        }
    }
}

判断闰年

原文:http://blog.csdn.net/zjx211314/article/details/39158027

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!