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;
- namespace podatkovnestruktire
- {
- class Program
- {
- static void Main(string[] args)
- {
- Stack<int> s = new Stack<int>();
- s.Push(2);
- s.Push(3);
- s.Push(4);
- s.Push(5);
- s.Push(6);
- s.Push(6);
- Stack<int> s1 = new Stack<int>();
- int v = s.Count;
- for (int i = 0; i < v; i++)
- {
- if (i % 2 == 0)
- {
- s1.Push(s.Pop());
- }
- else
- {
- s.Pop();
- }
- }
- Console.WriteLine(s1);
- Console.Read();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement