fbinnzhivko

Increasing 4 Numbers

Mar 16th, 2016
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.73 KB | None | 0 0
  1. using System;
  2. class Program
  3. {
  4.     static void Main()
  5.     {
  6.         var a = int.Parse(Console.ReadLine());
  7.         var b = int.Parse(Console.ReadLine());
  8.  
  9.         if (b - a < 3)
  10.         {
  11.             Console.WriteLine("No");
  12.         }
  13.         for (int first = a; first <= b - 3; first++)
  14.         {
  15.             for (int second = first + 1; second <= b - 2; second++)
  16.             {
  17.                 for (int third = second + 1; third <= b - 1; third++)
  18.                 {
  19.                     for (int four = third + 1; four <= b; four++)
  20.                     {
  21.                         Console.WriteLine("{0} {1} {2} {3}", first, second, third, four);
  22.                     }
  23.                 }
  24.             }
  25.         }
  26.     }
  27. }
Add Comment
Please, Sign In to add comment