Archived
1
0

Initial commit

This commit is contained in:
2025-10-24 17:19:46 +08:00
Unverified
commit acc0c9e220
155 changed files with 77369 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,25 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.14.36616.10 d17.14
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "C_Sharp_3_1", "C_Sharp_3_1.csproj", "{E11A2FAE-3F54-48C2-86B8-3AB7BFC20869}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E11A2FAE-3F54-48C2-86B8-3AB7BFC20869}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E11A2FAE-3F54-48C2-86B8-3AB7BFC20869}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E11A2FAE-3F54-48C2-86B8-3AB7BFC20869}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E11A2FAE-3F54-48C2-86B8-3AB7BFC20869}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {F31B64FE-9C56-4D0A-9ACD-B8037F502CA0}
EndGlobalSection
EndGlobal

View File

@@ -0,0 +1,36 @@
using System;
namespace C_Sharp_3_1
{
public class Program
{
static void Main()
{
int n = -1, result = 1, i = 1;
Console.WriteLine("请输入一个正整数n");
while (n < 0)
{
n = int.Parse(Console.ReadLine());
}
// For循环实现阶乘
for (i = 1; i <= n; i++)
{
result *= i;
}
Console.WriteLine("for 循环 {0}={1}", n, result);
// while循环实现阶乘
while (n > 1)
{
result *= n;
n--;
}
Console.WriteLine("while 循环 {0}={1}", n, result);
//do...while循环实现阶乘
do
{
result *= i;
i ++;
} while (i<=n);
Console.WriteLine("do...while 循环 {0}={1}", n, result);
}
}
}