コード例 #1
0
		public static void Main (string[] args)
		{
			Console.WriteLine ("Stack Example");
			StackOfString stck = new StackOfString ();
			string strInput = "temp";
			Console.WriteLine ("Enter Values On Stack");
			while (strInput != string.Empty) 
			{
				strInput = Console.ReadLine ();
				if (strInput.Equals("-"))
					{
						Console.WriteLine(stck.Pop());
					}
				else
					{
						stck.Push(strInput);
					}
			} 
		}
コード例 #2
0
        public static void Main(string[] args)
        {
            Console.WriteLine("Stack Example");
            StackOfString stck     = new StackOfString();
            string        strInput = "temp";

            Console.WriteLine("Enter Values On Stack");
            while (strInput != string.Empty)
            {
                strInput = Console.ReadLine();
                if (strInput.Equals("-"))
                {
                    Console.WriteLine(stck.Pop());
                }
                else
                {
                    stck.Push(strInput);
                }
            }
        }