C#判断年份是否为闰年
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace 闰年
{
class Program
{
static void Main(string[] args)
{
int year;
Console.WriteLine("请输入年份");
year = Convert.ToInt32(Console.ReadLine());
if((year%400==0)||(year%4==0&&year%100!=0))
Console.WriteLine("It is leap year!");
else
Console.WriteLine("Tt is not a leap year!");
}
}
}
posted on 2019-06-14 22:51 chenyi2016 阅读(1151) 评论(0) 收藏 举报
浙公网安备 33010602011771号