daily pastebin goal
73%
SHARE
TWEET

Untitled

a guest Feb 22nd, 2019 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using System.Linq;
  3.  
  4. namespace Stack
  5. {
  6.     public class Program
  7.     {
  8.         public static void Main(string[] args)
  9.         {
  10.             Stack<int> stack = new Stack<int>();
  11.             foreach (var item in Enumerable.Range(1, 3))
  12.                 stack.Push(item);
  13.  
  14.             foreach (var item in stack)
  15.                 Console.WriteLine(item);
  16.  
  17.             for (int i = 0; i < stack.Count; i++)
  18.                 stack.Pop();
  19.            
  20.             Console.ReadLine();
  21.         }
  22.     }
  23. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top