c#字符串类型的入队、出队

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;

namespace ConsoleApplication1
{

    class Program
    {

        static void Main(string[] args)
        {
            string[] s = { "12", "+CBF-", "Y%7*", "gdYudb/" };
            Queue<string> q = new Queue<string>();
            for (int i = 0; i < s.Length; i++)
            {
                q.Enqueue(s[i]);
            }
            string result = "";
            while (q.Count > 0)
            {
                result += q.Dequeue();
            }
            Console.WriteLine(result);

            Console.Read();
        }
    }
}

阅读更多
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭
关闭