Archived
1
0

统一归档20260319

This commit is contained in:
2026-03-19 19:39:01 +08:00
Unverified
parent 4e148364a9
commit 3ea0af246b
187 changed files with 5041 additions and 75005 deletions

11
CS/lab10/10_2/10_2.csproj Normal file
View File

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

25
CS/lab10/10_2/10_2.sln Normal file
View 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_2", "10_2.csproj", "{0F5EF24A-118F-49CD-9A90-019285EB79A8}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{0F5EF24A-118F-49CD-9A90-019285EB79A8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0F5EF24A-118F-49CD-9A90-019285EB79A8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0F5EF24A-118F-49CD-9A90-019285EB79A8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0F5EF24A-118F-49CD-9A90-019285EB79A8}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {3BA90027-911E-4AE7-8B9C-66DDE3494B4E}
EndGlobalSection
EndGlobal

29
CS/lab10/10_2/Program.cs Normal file
View File

@@ -0,0 +1,29 @@
using System.Collections;
namespace _10_2
{
internal class Program
{
static void Main(string[] args)
{
ArrayList redballs = new ArrayList() { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33 };
ArrayList blueballs = new ArrayList() { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 };
ArrayList redball = new ArrayList();
Random randobj = new Random();
int blueball=randobj.Next(1, 16);
for (int i = 0; i < 6; i++)
{
int index = randobj.Next(0, redballs.Count);
redball.Add(redballs[index]);
redballs.RemoveAt(index);
}
Console.WriteLine("Red Balls:");
foreach (var item in redball)
{
Console.Write(item + " ");
}
Console.WriteLine("\nBlue Ball:");
Console.WriteLine(blueball);
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB