aneliabogeva

Untitled

Apr 4th, 2019
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.21 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 _Substitute
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int k = int.Parse(Console.ReadLine());
  14. int l = int.Parse(Console.ReadLine());
  15. int m = int.Parse(Console.ReadLine());
  16. int n = int.Parse(Console.ReadLine());
  17. string combination = string.Empty;
  18.  
  19. int combinationCount = 0;
  20. while (combinationCount < 6)
  21. {
  22. for (int i = k; i <= 8; i++)
  23. {
  24. for (int j = 9; j >= l; j--)
  25. {
  26. for (int b = m; b <= 8; b++)
  27. {
  28. for (int c = 9; c >= n; c--)
  29. {
  30. combination = $"{i}{j} - {b}{c}";
  31. if (i % 2 == 0)
  32. {
  33. if (j % 2 != 0)
  34. {
  35. if (b % 2 == 0)
  36. {
  37. if (c % 2 != 0)
  38. {
  39.  
  40. if (i == b && j == c)
  41. {
  42. Console.WriteLine("Cannot change the same player.");
  43. }
  44. else
  45. {
  46. Console.WriteLine(combination);
  47. combinationCount += 1;
  48.  
  49. }
  50. }
  51. }
  52. }
  53. }
  54. }
  55. }
  56. }
  57. break;
  58. }
  59. }
  60. }
  61. }
  62. }
Advertisement
Add Comment
Please, Sign In to add comment