CCCPaste

NCTU LAB 12/03 NUM 4

#include 
using namespace std;

void bubbleSort(int arr[], int n){
    for(int i=0;iarr[j+1]){
                int temp = arr[j];
                arr[j] = arr[j+1];
                arr[j+1] = temp;
                swap = true;
            }
        }
        if(!swap){
            break;
        }
    }
}

void ssearch(int x[], int y[], int z[], int l, int m, int n){
    int i=0, j=0, k=0;
    while(i> a >> b >> c;
    int *fData = new int[a];
    int *sData = new int[b];
    int *tData = new int[c];
    cout << "Input the elements in array I: ";
    for(int i=0;i> fData[i];
    }
    cout << "Input the elements in array II: ";
    for(int i=0;i> sData[i];
    }
    cout << "Input the elements in array III: ";
    for(int i=0;i> tData[i];
    }
    bubbleSort(fData, a), bubbleSort(sData, b), bubbleSort(tData, c);
    ssearch(fData, sData, tData, a, b, c);
    delete[] fData, sData, tData;
    return 0;
}