23 lines
523 B
C#
23 lines
523 B
C#
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());
|
|
}
|
|
}
|
|
}
|
|
}
|