题目描述
使用C#编写一个控制台应用。输入-一个年份,判断是否润年(被4整除,且不被100整除,或者被400整除)。
是闰年输出yes,不是输出no
输入
一个年份
输出
yes或者no
样例输入
copy
1996
样例输出
yes
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
int m =int.Parse(Console.ReadLine());
if ((m % 4 == 0 && m % 100 != 0 || m % 400 == 0))
{
Console.WriteLine("yes");
}
else
{
Console.WriteLine("no");
}
Console.ReadKey();
}
}
}