This commit is contained in:
优雅的母鸡 2023-09-07 11:41:10 +08:00
parent c327ae81c9
commit 652cfe9d72
23 changed files with 459 additions and 0 deletions

View File

@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.8.34004.107
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "第一课_你好世界", "第一课_你好世界\第一课_你好世界.csproj", "{0B7E78CF-B740-421B-AE6B-CE95CAAD5576}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{0B7E78CF-B740-421B-AE6B-CE95CAAD5576}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0B7E78CF-B740-421B-AE6B-CE95CAAD5576}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0B7E78CF-B740-421B-AE6B-CE95CAAD5576}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0B7E78CF-B740-421B-AE6B-CE95CAAD5576}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {1749DBB7-9D4B-4479-A144-97F8DB77B19B}
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,10 @@
namespace _你好世界
{
internal class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello, World!");
}
}
}

View File

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

View File

@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.8.34004.107
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "第三课_输入和输出", "第三课_输入和输出\第三课_输入和输出.csproj", "{D27EDDBE-7FA5-400D-A504-83D38875A91E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "简单计算", "简单计算\简单计算.csproj", "{1BC77195-2965-4950-8287-8C207033DA77}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{D27EDDBE-7FA5-400D-A504-83D38875A91E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D27EDDBE-7FA5-400D-A504-83D38875A91E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D27EDDBE-7FA5-400D-A504-83D38875A91E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D27EDDBE-7FA5-400D-A504-83D38875A91E}.Release|Any CPU.Build.0 = Release|Any CPU
{1BC77195-2965-4950-8287-8C207033DA77}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1BC77195-2965-4950-8287-8C207033DA77}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1BC77195-2965-4950-8287-8C207033DA77}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1BC77195-2965-4950-8287-8C207033DA77}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {660C84A7-A259-447F-8382-8183569822DA}
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,12 @@
namespace _输入和输出
{
internal class Program
{
static void Main(string[] args)
{
Console.Write("请输入你的姓名:");
string = Console.ReadLine();
Console.WriteLine("你好!" + + "欢迎来到C#的世界");
}
}
}

View File

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

View File

@ -0,0 +1,23 @@
namespace
{
internal class Program
{
static void Main(string[] args)
{
Console.WriteLine("欢迎使用加法计算器!");
Console.Write("请输入第一个数字:");
string 1 = Console.ReadLine();
Console.Write("请输入第二个数字:");
string 2 = Console.ReadLine();
//int 数字1 = Convert.ToInt32(数字输入1); //思考输入的数据类型,是不是有可能会输入含有小数的内容?
//int 数字2 = Convert.ToInt32(数字输入2);
double 1 = Convert.ToDouble(1);
double 2 = Convert.ToDouble(2);
double = 1 + 2;
Console.WriteLine("计算结果是结果是" + );
}
}
}

View File

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

View File

@ -0,0 +1,28 @@
namespace
{
internal class Program
{
static void Main(string[] args)
{
Console.Write("int数据类型的最大值是:");
Console.WriteLine(int.MaxValue);
Console.Write("int数据类型的最小值是:");
Console.WriteLine(int.MinValue);
Console.Write("uint数据类型的最大值是:");
Console.WriteLine(uint.MaxValue);
Console.Write("uint数据类型的最小值是:");
Console.WriteLine(uint.MinValue);
Console.Write("double数据类型的最大值是:");
Console.WriteLine(double.MaxValue);
Console.Write("double数据类型的最小值是:");
Console.WriteLine(double.MinValue);
}
}
}

View File

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

View File

@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.8.34004.107
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "第二课_数据类型", "第二课_数据类型\第二课_数据类型.csproj", "{98DFD84B-2E81-426F-A5EC-8435B355F880}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "数据类型范围", "数据类型范围\数据类型范围.csproj", "{6539CF5A-A76C-4953-A51A-BAB67067237B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{98DFD84B-2E81-426F-A5EC-8435B355F880}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{98DFD84B-2E81-426F-A5EC-8435B355F880}.Debug|Any CPU.Build.0 = Debug|Any CPU
{98DFD84B-2E81-426F-A5EC-8435B355F880}.Release|Any CPU.ActiveCfg = Release|Any CPU
{98DFD84B-2E81-426F-A5EC-8435B355F880}.Release|Any CPU.Build.0 = Release|Any CPU
{6539CF5A-A76C-4953-A51A-BAB67067237B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6539CF5A-A76C-4953-A51A-BAB67067237B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6539CF5A-A76C-4953-A51A-BAB67067237B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6539CF5A-A76C-4953-A51A-BAB67067237B}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {BD4A6C46-03D4-41CD-AE03-037FC252732D}
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,57 @@
namespace _数据类型
{
internal class Program
{
static void Main(string[] args)
{
int Int = 0;
Console.Write("Int的值是:");
Console.WriteLine(Int);
uint Uint = 0;
Console.Write("Uint的值是:");
Console.WriteLine(Uint);
short Short = 0;
Console.Write("Short的值是:");
Console.WriteLine(Short);
ushort Ushort = 0;
Console.Write("Ushort的值是:");
Console.WriteLine(Ushort);
long Long = 0;
Console.Write("Long的值是:");
Console.WriteLine(Long);
ulong Ulong = 0;
Console.Write("Ulong的值是:");
Console.WriteLine(Ulong);
float Float = 0.0F;
Console.Write("Float的值是:");
Console.WriteLine(Float);
double Double = 0.0;
Console.Write("Double的值是:");
Console.WriteLine(Double);
decimal Decimal = 0.0M;
Console.Write("Decimal的值是:");
Console.WriteLine(Decimal);
char Char = 'A';
Console.Write("Char的值是:");
Console.WriteLine(Char);
string String = "这是一个字符串";
Console.Write("String的值是:");
Console.WriteLine(String);
bool Bool = false;
Console.Write("Bool的值是:");
Console.WriteLine(Bool);
}
}
}

View File

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

View File

@ -0,0 +1,30 @@
namespace while循环
{
internal class Program
{
static void Main(string[] args)
{
Console.WriteLine("猜数字游戏,数字在" + 0 + "到" + 100 + "之间");
int = new Random().Next(0,100);//随机生成一个数字,在0到100之间
int = 0;
while (!=)
{
Console.Write("请输入你猜测的数字:");
= Convert.ToInt32(Console.ReadLine());
if( > )
{
Console.WriteLine("你输入的数字太大了!");
}
if ( < )
{
Console.WriteLine("你输入的数字太小了!");
}
}
Console.WriteLine("恭喜你!猜对了!");
}
}
}

View File

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

View File

@ -0,0 +1,23 @@
namespace
{
internal class Program
{
static void Main(string[] args)
{
int[] ints = new int[10];
for (int i = 0; i < ints.Length; i++)
{
Console.Write(ints[i]+"\t");
}
Console.WriteLine();
for (int i = 0; i < ints.Length; i++)
{
ints[i] = i * 2;
}
foreach(int item in ints)
{
Console.Write(item + "\t");
}
}
}
}

View File

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

View File

@ -0,0 +1,37 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.8.34004.107
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "第五课_循环语句", "第五课_循环语句\第五课_循环语句.csproj", "{AC443FFF-850C-475E-AF7D-2F64BDC0E963}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "while循环", "while循环\while循环.csproj", "{7B275C38-2015-4752-A0C7-607856E87FE0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "数组", "数组\数组.csproj", "{5F086597-2330-42AD-847B-A9AD1EF4B301}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{AC443FFF-850C-475E-AF7D-2F64BDC0E963}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AC443FFF-850C-475E-AF7D-2F64BDC0E963}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AC443FFF-850C-475E-AF7D-2F64BDC0E963}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AC443FFF-850C-475E-AF7D-2F64BDC0E963}.Release|Any CPU.Build.0 = Release|Any CPU
{7B275C38-2015-4752-A0C7-607856E87FE0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7B275C38-2015-4752-A0C7-607856E87FE0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7B275C38-2015-4752-A0C7-607856E87FE0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7B275C38-2015-4752-A0C7-607856E87FE0}.Release|Any CPU.Build.0 = Release|Any CPU
{5F086597-2330-42AD-847B-A9AD1EF4B301}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5F086597-2330-42AD-847B-A9AD1EF4B301}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5F086597-2330-42AD-847B-A9AD1EF4B301}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5F086597-2330-42AD-847B-A9AD1EF4B301}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {F121C50F-6D08-46ED-B2BB-8161EF768043}
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,13 @@
namespace _循环语句
{
internal class Program
{
static void Main(string[] args)
{
for (int i = 0; i < 10; i++)
{
Console.WriteLine("循环执行,第" + i + "次");
}
}
}
}

View File

@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.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.8.34004.107
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "第四课_if语句", "第四课_if语句\第四课_if语句.csproj", "{39DDB7D2-98E9-4604-9EC5-D035345D0B5B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{39DDB7D2-98E9-4604-9EC5-D035345D0B5B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{39DDB7D2-98E9-4604-9EC5-D035345D0B5B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{39DDB7D2-98E9-4604-9EC5-D035345D0B5B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{39DDB7D2-98E9-4604-9EC5-D035345D0B5B}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {860F54DC-178E-4A5B-8F07-4161883FA381}
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,24 @@
namespace _if语句
{
internal class Program
{
static void Main(string[] args)
{
Console.Write("请输入三角形的第一个边长度:");
double a = Convert.ToInt32(Console.ReadLine());
Console.Write("请输入三角形的第二个边长度:");
double b = Convert.ToInt32(Console.ReadLine());
Console.Write("请输入三角形的第三个边长度:");
double c = Convert.ToInt32(Console.ReadLine());
if ((a + b > c) && (a + c > b) && (b + c > a))
{
Console.WriteLine("三角形成立!");
}
else
{
Console.WriteLine("三角形不成立!");
}
}
}
}

View File

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