Advertisement
Guest User

Untitled

a guest
Sep 14th, 2014
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.04 KB | None | 0 0
  1.    class Program
  2.     {
  3.         private static int MAX;
  4.         private static int a;
  5.         private static int b;
  6.         private static int c;
  7.         private static int Increment;
  8.  
  9.         static void Main(string[] args)
  10.         {
  11.             MAX = 10;
  12.             a = 1;
  13.             b = 4;
  14.             c = 7;
  15.             Increment = 0;
  16.  
  17.  
  18.             while(a < MAX || b < MAX || c < MAX)
  19.             {
  20.                 switch (Increment)
  21.                 {
  22.                     case 0: { PrintVars(a); break; }
  23.                     case 1: { PrintVars(b); break; }
  24.                     case 2: { PrintVars(c); break; }
  25.                     default: { Increment = 0; break; }
  26.                 }
  27.             }
  28.             Console.ReadLine();
  29.         }
  30.  
  31.         public static void PrintVars(int toincrease)
  32.         {
  33.             if (toincrease == a) a++;
  34.             else if (toincrease == b) b++;
  35.             else if (toincrease == c) c++;
  36.             Increment++;
  37.             Console.WriteLine(a + ", " + b + ", " + c);
  38.         }
  39.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement