veronikaaa86

11. 5 Different Numbers

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