Advertisement
aneliabogeva

Untitled

Apr 4th, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.72 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.  
  21. for (int i = k; i <= 8; i++)
  22. {
  23. for (int j = 9; j >= l; j--)
  24. {
  25. for (int b = m; b <= 8; b++)
  26. {
  27. for (int c = 9; c >= n; c--)
  28. {
  29. combination = $"{i}{j} - {b}{c}";
  30.  
  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. if (i == b && j == c)
  40. {
  41. Console.WriteLine("Cannot change the same player.");
  42. }
  43. else
  44. {
  45. Console.WriteLine(combination);
  46. combinationCount += 1;
  47. }
  48. if (combinationCount == 6)
  49. {
  50. break;
  51. }
  52. }
  53. }
  54. }
  55. }
  56. if (combinationCount == 6)
  57. {
  58. break;
  59. }
  60. }
  61. if (combinationCount == 6)
  62. {
  63. break;
  64. }
  65. }
  66. if (combinationCount == 6)
  67. {
  68. break;
  69. }
  70. }
  71. if (combinationCount == 6)
  72. {
  73. break;
  74. }
  75. }
  76. }
  77. }
  78. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement