Advertisement
martinvalchev

5 Different Numbers

Jan 30th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.15 KB | None | 0 0
  1. using System;
  2.  
  3. namespace test
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int a = int.Parse(Console.ReadLine());
  10.             int b = int.Parse(Console.ReadLine());
  11.  
  12.             if (b - a > 3)
  13.             {
  14.  
  15.                 for (int i = a; i <= b; i++)
  16.                 {
  17.                     for (int j = a; j <= b; j++)
  18.                     {
  19.                         for (int k = a; k <= b; k++)
  20.                         {
  21.                             for (int m = a; m <= b; m++)
  22.                             {
  23.                                 for (int n = a; n <= b; n++)
  24.                                 {
  25.                                     if (i < j && j < k && k < m && m < n)
  26.                                     {
  27.                                         Console.WriteLine($"{i} {j} {k} {m} {n}");
  28.                                     }
  29.                                 }
  30.                             }
  31.                         }
  32.                     }
  33.                 }
  34.  
  35.             }
  36.             else
  37.             {
  38.                 Console.WriteLine("No");
  39.             }
  40.         }
  41.     }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement