include 
         
 
        using namespace std;
 //Function prototype
 int* selectSort(int ,int);
 void showArray(const int [],int);
 int main()
 {
 int array[] = {7,2,4,5,9,10};
 int size = sizeof(array)/sizeof(array[0]);//求數組的長度
 showArray(array,size);
 selectSort(array,size);
 showArray(array, size);
 cout <<array<< endl;
 return 0;
 }
 int selectSort(int p,int size)
 {
 int temp;
 int swap;
 do
 {
 swap = false;
 for (int i = 0; i < (size - 1);i++)
 {
 if ((p+i) > *(p +i+ 1))
 {
 temp = *(p+i);
 *(p + i) = *(p + i + 1);
 *(p + i + 1) = temp;
 swap = true;
 }
 }
} while (swap);
return p;
 
        }
 void showArray(const int array[], int size)
 {
 for (int count=0;count<size;count++)
 {
 cout << array[count] <<" ";
 }
 cout << endl;
 }
