Advertisement
YavorJS

Increasing 4 numbers

Jul 1st, 2016
261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 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.  
  8. class Program
  9. {
  10. static void Main()
  11. {
  12.  
  13. int a = int.Parse(Console.ReadLine());
  14. int b = int.Parse(Console.ReadLine());
  15. bool c = false;
  16. for (int num1 = a; num1 <= b; num1++)
  17. {
  18. for (int num2 = a; num2 <= b; num2++)
  19. {
  20. for (int num3 = a; num3 <= b; num3++)
  21. {
  22. for (int num4 = a; num4 <= b; num4++)
  23. {
  24. if (a<=num1 && num1<num2 && num2<num3 && num3<num4 && num4<=b)
  25. {
  26. Console.WriteLine(num1+" "+num2 + " " + num3 + " " + num4);
  27.  
  28. }
  29. else
  30. {
  31. c = true;
  32. }
  33.  
  34. }
  35. }
  36. }
  37. }//end of for
  38. if (c)
  39. {
  40. Console.WriteLine("No");
  41. }
  42.  
  43. }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement