add HelloDotNetGuide
This commit is contained in:
|
Before Width: | Height: | Size: 762 KiB After Width: | Height: | Size: 762 KiB |
|
Before Width: | Height: | Size: 496 KiB After Width: | Height: | Size: 496 KiB |
@@ -1,33 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CSharpAlgorithm
|
||||
{
|
||||
public class ListSetAlgorithm
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取移除后的列表数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static List<int> GetAfterRemoveListData()
|
||||
{
|
||||
List<int> list = new List<int>();
|
||||
for (int i = 1; i <= 10; i++)
|
||||
{
|
||||
list.Add(i);
|
||||
}
|
||||
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
list.RemoveAt(i);//输出结果:2,4,6,8,10,按照索引移除
|
||||
list.Remove(i);//输出结果:5,6,7,8,9,10,按照对象移除
|
||||
}
|
||||
|
||||
//以上两种同时使用时输出结果:6,7,9
|
||||
return list;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace CSharpAlgorithm
|
||||
{
|
||||
class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
var getListData = ListSetAlgorithm.GetAfterRemoveListData();
|
||||
foreach (var itemValue in getListData)
|
||||
{
|
||||
Console.WriteLine(itemValue);
|
||||
}
|
||||
|
||||
Console.WriteLine("Hello World!");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.31112.23
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.6.33815.320
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSharpAlgorithm", "CSharpAlgorithm\CSharpAlgorithm.csproj", "{8D90F8AE-CF60-437E-892E-1366B4561A86}"
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HelloDotNetGuide", "HelloDotNetGuide\HelloDotNetGuide.csproj", "{2E168BE3-C54F-4311-88FC-A891BA62F308}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
@@ -11,15 +11,15 @@ Global
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{8D90F8AE-CF60-437E-892E-1366B4561A86}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{8D90F8AE-CF60-437E-892E-1366B4561A86}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{8D90F8AE-CF60-437E-892E-1366B4561A86}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{8D90F8AE-CF60-437E-892E-1366B4561A86}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{2E168BE3-C54F-4311-88FC-A891BA62F308}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{2E168BE3-C54F-4311-88FC-A891BA62F308}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{2E168BE3-C54F-4311-88FC-A891BA62F308}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{2E168BE3-C54F-4311-88FC-A891BA62F308}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {28857D41-E735-49D4-B35C-AA9F0882F74E}
|
||||
SolutionGuid = {7B103172-7D9E-472A-93BA-BB9BCE87F1FC}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -3,6 +3,12 @@
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="C#常见算法\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
10
src/DotNetGuide/HelloDotNetGuide/Program.cs
Normal file
10
src/DotNetGuide/HelloDotNetGuide/Program.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
namespace HelloDotNetGuide
|
||||
{
|
||||
internal class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
Console.WriteLine("Hello DotNetGuide!");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user