添加Lesson3
This commit is contained in:
@@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user