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.Text;
- using System.Threading.Tasks;
- class StuckNumbers
- {
- static void Main()
- {
- int n = int.Parse(Console.ReadLine());
- int[] nums = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
- bool match = false;
- for (int i1 = 0; i1 < nums.Length; i1++)
- {
- for (int i2 = 0; i2 < nums.Length; i2++)
- {
- for (int i3 = 0; i3 < nums.Length; i3++)
- {
- for (int i4 = 0; i4 < nums.Length; i4++)
- {
- int a = nums[i1];
- int b = nums[i2];
- int c = nums[i3];
- int d = nums[i4];
- if (a != b && a != c && a != d && b != c && b != d && c != d)
- {
- String right = "" + a + b;
- String left = "" + c + d;
- if (right.Equals(left))
- {
- Console.WriteLine(a + "|" + b + "==" + c + "|" + d);
- match = true;
- }
- }
- }
- }
- }
- }
- if (!match)
- {
- Console.WriteLine("No");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement