public static void SaveStack() {

            string result = "Hello World";
            Stack st = new Stack();
            for (int i = 0; i < result.Length; i++)
            {
                st.Push(result[i]);
            }
          
            var zzz=st.Peek();
            Console.WriteLine("zzz:" + zzz);
            //st.Clear();
            var r = st.ToArray();
            Console.WriteLine(string.Join(",",r));
            Console.ReadLine();
}

  

posted on 2019-01-24 09:44  梁娜  阅读(142)  评论(0编辑  收藏  举报