madeofglass

Untitled

Mar 5th, 2020
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.93 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _11.Increasing4Numbers
  4. {
  5.     class Increasing4Numbers
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             var a = int.Parse(Console.ReadLine());
  10.             var b = int.Parse(Console.ReadLine());
  11.  
  12.             if (b - a < 3)
  13.             {
  14.                 Console.WriteLine("No");
  15.             }
  16.  
  17.  
  18.             for (int first = a; first <= b - 3; first++)
  19.             {
  20.                 for (int second = first + 1; second <= b - 2; second++)
  21.                 {
  22.                     for (int third = second + 1; third <= b - 1; third++)
  23.                     {
  24.                         for (int fourth = third + 1; fourth <= b; fourth++)
  25.                         {
  26.                             Console.WriteLine("{0} {1} {2} {3}",
  27.                                 first, second, third, fourth);
  28.                         }
  29.                     }
  30.                 }
  31.             }
  32.         }
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment