统一归档20260319
This commit is contained in:
11
CS/lab10/10_3/10_3.csproj
Normal file
11
CS/lab10/10_3/10_3.csproj
Normal file
@@ -0,0 +1,11 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<RootNamespace>_10_3</RootNamespace>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
25
CS/lab10/10_3/10_3.sln
Normal file
25
CS/lab10/10_3/10_3.sln
Normal file
@@ -0,0 +1,25 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.14.36717.8 d17.14
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "10_3", "10_3.csproj", "{623C00AF-6FA2-4DA4-8EF6-1DFE6A08A215}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{623C00AF-6FA2-4DA4-8EF6-1DFE6A08A215}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{623C00AF-6FA2-4DA4-8EF6-1DFE6A08A215}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{623C00AF-6FA2-4DA4-8EF6-1DFE6A08A215}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{623C00AF-6FA2-4DA4-8EF6-1DFE6A08A215}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {CAE20878-4FEF-4790-B2CE-2FD71B7C534D}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
32
CS/lab10/10_3/Program.cs
Normal file
32
CS/lab10/10_3/Program.cs
Normal file
@@ -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