#include <iostream>
#include <string>
using namespace std; 

int main() { 
    int UnList[10]; 
    int SList[10]; 
    int i,j,n,x,s;
    int nVal; // Ask user to insert the values for the Unsorted List.
    cout << "Please insert 10 integers numbers:" << endl; 
    for(i=0; i< 10; i++){ 
        cout << "[" << i <<"]" << "= ";
        cin >> nVal;
        cout << endl;
        UnList[i]={nVal};
        }// end of loop for storing the values. 
        //Display the Unsorted List 
        cout << "Unsorted List: ";
        for(j=0; j<10; j++){ 
            cout << UnList[j] << ",";
        }
        cout << endl;
        cout << "Sorting ..."<< endl;
        //Selection Sort Algorithm 
        for (n = 0; n <10; n++){ 
            for (x=0; x<9; x++){
                if (UnList[x] > UnList[x+1]){
                    s = UnList[x+1];
                    UnList[x+1] = UnList[x];
                    UnList[x] = s;
                 } 
            } 
            //SList[n] = UnList[n];
        }// end of the Linear Search method... 
         //end of the Sorting Method... 
        
        //Display Sorted List 
        cout << "Sorted List: "; 
        for(i = 0; i<10; i++){ 
            cout << UnList[i] << " "; 
        } 
}