Facebook
From Mustard Mosquito, 6 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 279
  1. using System;
  2. using System.Collections;
  3.  
  4.  
  5. namespace cwiczenie_kolejka_stost
  6. {
  7.     class Program
  8.     {
  9.        
  10.         static void Main(string[] args)
  11.         {
  12.             int[] tab = new int[0];
  13.             int dlugosc = 0;
  14.  
  15.             void Push(int liczba)
  16.             {
  17.                 Queue liczby = new Queue();
  18.  
  19.                 foreach ()
  20.                    
  21.                 {
  22.                     liczby.Enqueue(liczba);
  23.                     Console.WriteLine(liczba + " dodana do kolejki");
  24.                 }
  25.  
  26.                 foreach (int liczba in liczby)
  27.                 {
  28.                     Console.WriteLine(liczba);
  29.                 }
  30.  
  31.                 while (liczby.Count != 0)
  32.                 {
  33.                     int liczba = (int)liczby.Dequeue();
  34.                     Console.WriteLine(liczba + " odjeta z kolejki");
  35.                 }
  36.                 Console.ReadKey();
  37.  
  38.             }
  39.  
  40.  
  41.            
  42.        
  43.         }
  44.        
  45.     }
  46. }
  47.