Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- namespace Set
- {
- class Program
- {
- static void Main(string[] args)
- {
- {
- Console.WriteLine("Enter A");
- string[] tokensA = Console.ReadLine().Split();
- HashSet<int> A = new HashSet<int>();
- Console.WriteLine("Enter B");
- string[] tokensB = Console.ReadLine().Split();
- HashSet<int> B = new HashSet<int>();
- Console.WriteLine("Enter C");
- string[] tokensC = Console.ReadLine().Split();
- HashSet<int> C = new HashSet<int>();
- Console.WriteLine("Enter D");
- string[] tokensD = Console.ReadLine().Split();
- HashSet<int> D = new HashSet<int>();
- for (int i = 0; i < tokensA.Length; i++)
- {
- A.Add(int.Parse(tokensA[i]));
- }
- for (int i = 0; i < tokensB.Length; i++)
- {
- B.Add(int.Parse(tokensB[i]));
- }
- for (int i = 0; i < tokensC.Length; i++)
- {
- C.Add(int.Parse(tokensC[i]));
- }
- for (int i = 0; i < tokensD.Length; i++)
- {
- D.Add(int.Parse(tokensD[i]));
- }
- if(B.IsSubsetOf(A) == true)
- {
- Console.WriteLine("AB");
- }
- if (C.IsSubsetOf(A) == true)
- {
- Console.WriteLine("AC");
- }
- if (D.IsSubsetOf(A) == true)
- {
- Console.WriteLine("AD");
- }
- if (B.IsSubsetOf(C) == true)
- {
- Console.WriteLine("CB");
- }
- if (D.IsSubsetOf(C) == true)
- {
- Console.WriteLine("CD");
- }
- if (A.IsSubsetOf(C) == true)
- {
- Console.WriteLine("CA");
- }
- if (D.IsSubsetOf(B) == true)
- {
- Console.WriteLine("BD");
- }
- if (A.IsSubsetOf(B) == true)
- {
- Console.WriteLine("BA");
- }
- if (C.IsSubsetOf(B) == true)
- {
- Console.WriteLine("BC");
- }
- if (A.IsSubsetOf(D) == true)
- {
- Console.WriteLine("DA");
- }
- if (B.IsSubsetOf(D) == true)
- {
- Console.WriteLine("DB");
- }
- if (C.IsSubsetOf(D) == true)
- {
- Console.WriteLine("DC");
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement