62,074
社区成员
发帖
与我相关
我的任务
分享
using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication29
{
class Program
{
static void Main(string[] args)
{
int m1 =200709;
int m2 =200804;
while (m1 <= m2)
{
Console.WriteLine(m1);
if (m1 % 12 == 0)
m1 = m1 + 100-11;
else
m1++;
}
Console.Read();
}
}
}
DateTime start = new DateTime(2007, 9, 1);
DateTime end = new DateTime(2008, 4, 1);
DateTime current = start;
while (current <= end)
{
System.Console.WriteLine(current.ToString("yyyyMM"));
current = current.AddMonths(1);
}