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); } } }
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); } } }