BubaLazi

5DifferentNums

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