Advertisement
Guest User

Untitled

a guest
Sep 21st, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.05 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace sklad2
  7. {
  8.     class Program
  9.     {
  10.         static void Main(string[] args)
  11.         {
  12.             Stack<int> skl = new Stack<int>();
  13.             Stack<int> skl2 = new Stack<int>();
  14.             int število;
  15.  
  16.             skl.Push(0);
  17.             skl.Push(1);
  18.             skl.Push(2);
  19.             skl.Push(3);
  20.             skl.Push(4);
  21.             skl.Push(5);
  22.             skl.Push(6);
  23.             skl.Push(7);
  24.             skl.Push(8);
  25.  
  26.             for (int i = 0; i < skl.Count(); i++)
  27.             {
  28.                 if (i % 2 == 0)
  29.                 {
  30.                     skl.Peek();
  31.                     skl.Clear();
  32.                 }
  33.             }
  34.                 /*if (i % 2 == 0)
  35.                 {
  36.                     s.Peek();
  37.                     s.Clear();
  38.                 }*/
  39.             foreach (int i in skl)
  40.             {
  41.                 število = skl.Peek();
  42.                 Console.ReadLine(število);
  43.             }
  44.         }
  45.     }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement