Advertisement
Raizekas

Untitled

Mar 5th, 2016
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.67 KB | None | 0 0
  1.         static void Rikiuoti(ref Kolekcionierius K)
  2.         {
  3.             bool arBuvoKeitimu = true;
  4.             Atvirukas temp;         // temporary object
  5.             while (arBuvoKeitimu)
  6.             {
  7.                 arBuvoKeitimu = false;
  8.                 for (int i = 0; i <= K.kiek - 1)
  9.                 {
  10.                     if (K.Atvirukai[i].metai > K.Atvirukai[i-1].metai)
  11.                     {
  12.                         temp = K.Atvirukai[i];
  13.                         K.Atvirukai[i] = K.Atvirukai[i - 1];
  14.                         K.Atvirukai[i - 1] = temp;
  15.                         arBuvoKeitimu = true;
  16.                     }
  17.                 }
  18.             }
  19.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement