#include <iostream>
#include <cstring>

using namespace std;

int main (){

    char data[10][40] = {     
      "",
      "Welcome",
      " !\"#$%&'()*+,-./0123456789:;<=>?@",
      "aBCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`",
      "abcdefghijklmnopqrstuvwxyZ{||||||||||}",
      "CD_ROM",
      "ROM",
      "SCS",
      "3.5 Floppi",
      ""
    };


    cout<<"Printing the array as is"<<endl<<endl;

    for (int i=0; i<10; i++){
            cout<<data[i]<<endl;
    }

    cout<<endl<<"Ordering the data in Alphabetical order"<<endl<<endl;


    // bubble sort

    for (int i=0 ; i<10-1 ; ++i) {
            char Tcopy[40];
            for (int j=i+1 ; j<10 ; ++j) {
                    if (strcmp(data[i], data[j]) > 0) {
                            strcpy(Tcopy, data[i]);
                            strcpy(data[i], data[j]);
                            strcpy(data[j], Tcopy);
                    }
            }
    }


    cout<<"Printing the array Sorted"<<endl<<endl;

    for (int i=0; i<10; i++){
            cout<<data[i]<<endl;
    }


// Pause
    cout<<endl<<endl<<endl<<"Please Close Console Window"<<endl;
    cin.ignore('\n', 1024);
    return(0);
}