Yachkov

Untitled

Feb 28th, 2021
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.11 KB | None | 0 0
  1. using System;
  2. using System.ComponentModel.DataAnnotations;
  3. using System.Diagnostics.Tracing;
  4. using System.Reflection;
  5. using System.Reflection.Metadata;
  6. using System.Runtime.ExceptionServices;
  7.  
  8. namespace ExercisesForSoftuni
  9. {
  10.     class Program
  11.     {
  12.         static void Main(string[] args)
  13.         {
  14.             int k = int.Parse(Console.ReadLine());//6
  15.             int l = int.Parse(Console.ReadLine());//7
  16.             int m = int.Parse(Console.ReadLine());//5
  17.             int n = int.Parse(Console.ReadLine());//6
  18.  
  19.             for (int i = k; i <= 8; i++) // 6
  20.             {
  21.                 if (i % 2 == 0)
  22.                 {
  23.                     for (int j = 9; j >= l; j--) // 9
  24.                     {
  25.                         if (j % 2 == 1)
  26.                         {
  27.                             for (int o = m; o <= 8; o++) // 6
  28.                             {
  29.                                 if (o % 2 == 0)
  30.                                 {
  31.                                     for (int p = 9; p >= n; p--) // 7
  32.                                     {
  33.                                         if (p % 2 == 1)
  34.                                         {
  35.                                             if (i % 2 == 0 && j % 2 == 1 && o % 2 == 0 & p % 2 == 1)
  36.                                             {
  37.                                                 if (i == o && j == p)
  38.                                                 {
  39.                                                     Console.WriteLine($"Cannot change the same player.");
  40.                                                 }
  41.                                                 else
  42.                                                 {
  43.                                                     Console.WriteLine($"{i}{j} - {o}{p}");
  44.                                                 }
  45.                                             }
  46.                                         }
  47.                                     }
  48.                                 }
  49.                             }
  50.                         }
  51.                     }
  52.                 }
  53.             }
  54.  
  55.         }
  56.     }
  57. }
  58.  
Advertisement
Add Comment
Please, Sign In to add comment