viraco4a

11. 5 Different Numbers

May 22nd, 2018
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.59 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 _11_DifferentNumber
  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. int n = b - a;
  16. if (n < 4)
  17. {
  18. Console.WriteLine("No");
  19. }
  20. else
  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. continue;
  35. }
  36. else
  37. {
  38. int[] array = new int[] { i, j, k, l, m };
  39. Console.Write(string.Join(" ", array));
  40. Console.WriteLine();
  41. }
  42. }
  43. }
  44. }
  45. }
  46. }
  47. }
  48. }
  49. }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment