Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Threading;
- class StuckNumbers
- {
- static void Main(string[] args)
- {
- int k = int.Parse(Console.ReadLine());
- string[] arrayNumbers = new string[k];
- arrayNumbers = Console.ReadLine().Trim().Split(' ').ToArray();
- bool isTrue = false;
- for (int aIndex = 0; aIndex < arrayNumbers.Length; aIndex++)
- {
- for (int bIndex = 0; bIndex < arrayNumbers.Length; bIndex++)
- {
- for (int cIndex = 0; cIndex < arrayNumbers.Length; cIndex++)
- {
- for (int dIndex = 0; dIndex < arrayNumbers.Length; dIndex++)
- {
- string a = arrayNumbers[aIndex];
- string b = arrayNumbers[bIndex];
- string c = arrayNumbers[cIndex];
- string d = arrayNumbers[dIndex];
- if (a != b && a != c && a != d && b != d && b != c && c != d)
- {
- string firstPart = a + b;
- string secondPart = c + d;
- if (firstPart == secondPart)
- {
- Console.WriteLine("{0}|{1}=={2}|{3}", a, b, c, d);
- isTrue = true;
- }
- }
- }
- }
- }
- }
- if (!isTrue)
- {
- Console.WriteLine("No");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement