2016C#判断是否为闰年

来源:互联网 发布:传奇网页游戏源码 编辑:程序博客网 时间:2024/05/18 04:56
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace consoleapplication1{    class Program    {        static void Main(string[] args)        {            String s;            s = Console.ReadLine();            int k = int.Parse(s);            if (((k % 4 == 0) && (k % 100 != 0)) || (k % 400 == 0))            {                Console.WriteLine("yes!");            }            else            {                Console.WriteLine("no!");            }        }    }}

0 0
原创粉丝点击