标签:blog os ar for 2014 log on c line
//语法:
public static bool IsLeapYear(int year)
//用法举例:
using System;
public class IsLeapYear
{
public static void Main()
{
for (int year = 1994; year <= 2014; year++)
{
if (DateTime.IsLeapYear(year))
{
Console.WriteLine("{0} is a leap year.", year);
DateTime leapDay = new DateTime(year, 2, 29);
DateTime nextYear = leapDay.AddYears(1);
Console.WriteLine(" One year from {0} is {1}.", leapDay.ToString("d"),nextYear.ToString("d"));
}
}
}
}标签:blog os ar for 2014 log on c line
原文地址:http://blog.csdn.net/lucky51222/article/details/39290269