#include<iostream>
#include<string.h>
using namespace std;
int main()
{
int i, j, tot;
char nameAll[50][20], nameOne[20];
cout<<"How many String to Enter (Max.50) ? ";
cin>>tot;
cout<<"Enter "<<tot<<" Strings (Names): ";
for(i=0; i<tot; i++)
cin>>nameAll[i];
for(i=1; i<tot; i++)
{
for(j=1; j<tot; j++)
{
if(strcmp(nameAll[j-1], nameAll[j])>0)
{
strcpy(nameOne, nameAll[j-1]);
strcpy(nameAll[j-1], nameAll[j]);
strcpy(nameAll[j], nameOne);
}
}
}
cout<<"\nStrings (Names) in Alphabetical order:\n";
for(i=0; i<tot; i++)
cout<<nameAll[i]<<endl;
cout<<endl;
return 0;
}