Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- class StuckNumbers
- {
- static void Main()
- {
- int n = int.Parse(Console.ReadLine());
- string[] input = Console.ReadLine().Split(' ').ToArray();
- //int[] numbers = new int[n];
- //for (int i = 0; i < numbers.Length; i++)
- //{
- // numbers[i] = int.Parse(input[i]);
- //}
- bool isPrint = false;
- for (int a = 0; a < n; a++)
- {
- for (int b = 0; b < n; b++)
- {
- for (int c = 0; c < n; c++)
- {
- for (int d = 0; d < n; d++)
- {
- if (a != b && a != c && a != d &&
- b != c && b != d && c != d)
- {
- string first = input[a] + input[b];
- string second = input[c] + input[d];
- if (first == second)
- {
- Console.WriteLine("{0}|{1}=={2}|{3}", input[a], input[b], input[c], input[d]);
- isPrint = true;
- }
- }
- }
- }
- }
- }
- if (isPrint == false)
- {
- Console.WriteLine("No");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement