Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Program
- {
- private static int MAX;
- private static int a;
- private static int b;
- private static int c;
- private static int Increment;
- static void Main(string[] args)
- {
- MAX = 10;
- a = 1;
- b = 4;
- c = 7;
- Increment = 0;
- while(a < MAX || b < MAX || c < MAX)
- {
- switch (Increment)
- {
- case 0: { PrintVars(a); break; }
- case 1: { PrintVars(b); break; }
- case 2: { PrintVars(c); break; }
- default: { Increment = 0; break; }
- }
- }
- Console.ReadLine();
- }
- public static void PrintVars(int toincrease)
- {
- if (toincrease == a) a++;
- else if (toincrease == b) b++;
- else if (toincrease == c) c++;
- Increment++;
- Console.WriteLine(a + ", " + b + ", " + c);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement