void unionTwoSets()
{
    // Write your source code for problem 3-2 in lab.
    int first_size; //첫번째 집합의 크기 
    int second_size;//두번쨰 집합의 크기 
    int *first_set;// 첫번째 집합
    int *second_set;// 두번째 집합
    int *unionSet; //합집합
   
   
    cout<<"Input the size of the first set : ";
    cin>>first_size;
    cout<<"Input the size of the second set : ";
    cin>>second_size;
   
    first_set = new int[20]; ////동적할당을 해줍니다.
    second_set = new int[20];
    unionSet = new int[40];
   
    srand((unsigned int)time(NULL)); //난수를 발생시킵니다.
   
 char research_flag;
    bool test = true;
    cout<<"The First set is { ";
    for (int  i =0; i<first_size; i++) {
        research_flag = 1;
        while (research_flag){
            research_flag = 0;
            test = true;
           
            int first_Temp = (rand()0);
            for (int sub_i =0 ; sub_i < i; sub_i++) {
                if(first_set[sub_i]==first_Temp){
                    research_flag =1;
                    test = false;
                    break;
                }
            }
            if(!test)
                break;
            first_set[i] = first_Temp;
            cout << first_set[i] << " ";
        }
    }
    cout<<"}";
   
    cout<<endl;
   
    char research_flagB;
    cout<<"The Second set is { ";
    for (int  i =0; i<second_size; i++) {
        research_flagB = 1;
        while (research_flagB){
            research_flagB = 0;
            test =  true;
           
            int second_Temp = (rand()0);
            for (int sub_i =0 ; sub_i < i; sub_i++) {
                if(second_set[sub_i]==second_Temp){
                    research_flagB =1;
                    test = false;
                    break;
                }
            }
            if(!test)
                break;
            second_set[i] = second_Temp;
            cout << second_set[i] << " ";
        }
    }
    cout<<"}";//
    cout<<endl;

    int count=0;
    for (int i = 0; i<first_size; i++)
        unionSet[i]=first_set[i]; //첫번째 집합을 먼저 합집합안에 저장//////
    int k = first_size;
  
    for (int j=0; j<=second_size; j++) {
        for (int l=0; l<=first_size; l++) {
           
            if (second_set[j]==unionSet[l]) {
                count++;
                break;
            }
            else
   {  
                unionSet[k]=second_set[j];
                j++;
                k++;   
            }
        }
    }
   
    cout<<"The union set is { ";
    for (int i = 0; i<first_size+second_size-count; i++) {
        cout<<unionSet[i]<<" ";
    }
    cout<<"}";
   
   
    delete [] first_set;
    delete [] second_set;
    delete [] unionSet;
}