添加Lesson3

This commit is contained in:
2025-10-11 11:21:51 +08:00
parent 921e096721
commit 6c30ef5c27
5 changed files with 143 additions and 0 deletions
@@ -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>
@@ -0,0 +1,22 @@
using System.Collections;
namespace Lesson3_Queue练习题
{
internal class Program
{
static void Main(string[] args)
{
Queue q = new Queue();
for(int i = 0; i < 10; i++)
{
Console.WriteLine("请输入消息:");
q.Enqueue(Console.ReadLine());
}
for(int i = 0; i < 10; i++)
{
Thread.Sleep(1000);
Console.WriteLine(q.Dequeue());
}
}
}
}