Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace DemoStack3
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.WriteLine("Demo de Stack");
- Stack<char> miPila = new Stack<char>();
- miPila.Push('a');
- miPila.Push('b');
- miPila.Push('c');
- Console.WriteLine(miPila.Pop());
- Console.WriteLine(miPila.Pop());
- Console.WriteLine(miPila.Pop());
- try
- {
- Console.WriteLine(miPila.Pop());
- }
- catch (Exception e)
- {
- Console.WriteLine(e.Message);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement