统一归档20260319
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
namespace _10_3
|
||||
{
|
||||
internal class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
const string s4 = " ";
|
||||
int nYear = DateTime.Today.Year;
|
||||
for (int nMonth = 1; nMonth <= 12; nMonth++)
|
||||
{
|
||||
DateTime d1 = new DateTime(nYear, nMonth, 1);
|
||||
Console.WriteLine("{0}/{1}", d1.Year, d1.Month);
|
||||
Console.WriteLine("Su Mo Tu We Th Fr Sa");
|
||||
int iWeeks = (int)d1.DayOfWeek;
|
||||
int iLastDay = d1.AddMonths(1).AddDays(-1).Day;
|
||||
for (int i = 0; i < iWeeks; i++)
|
||||
{
|
||||
Console.Write(s4);
|
||||
}
|
||||
for (int iDay = 1; iDay <= iLastDay; iDay++)
|
||||
{
|
||||
Console.Write(" {0:00} ", iDay);
|
||||
if ((iDay + iWeeks) % 7 == 0)
|
||||
{
|
||||
Console.WriteLine();
|
||||
}
|
||||
}
|
||||
Console.WriteLine();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user