Advertisement
AlexJC

Increasing 4 Numbers

Aug 27th, 2016
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 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 Increasing_4_Numbers
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int num1 = int.Parse(Console.ReadLine());
  14. int num2 = int.Parse(Console.ReadLine());
  15.  
  16. if ((num2 - num1) < 3)
  17. {
  18. Console.WriteLine("No");
  19. }
  20. else
  21. {
  22. for (int i = num1; i <= num2 - 3; i++)
  23. {
  24.  
  25. for (int j = num1 + 1; j <= num2 - 2; j++)
  26. if (j > i)
  27. {
  28.  
  29. for (int k = num1 + 2; k <= num2 - 1; k++)
  30. if (k > j)
  31. {
  32.  
  33. for (int l = num1 + 3; l <= num2; l++)
  34. if (l > k)
  35. {
  36. Console.Write("{0} ", i);
  37. Console.Write("{0} ", j);
  38. Console.Write("{0} ", k);
  39. Console.WriteLine("{0}", l);
  40. }
  41. }
  42. }
  43. }
  44. }
  45. }
  46. }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement