#2
TonyDeng2013-09-28 10:30
|
#include <iostream.h>
#include <string.h>
void main()
{
char * str[]={"Follow me","basic","great wall","department","computer"};
char * p;
int i,j;
for(i=0;i<5;i++)
for(j=i+1;j<5;j++)
{
if(strcmp(str[i],str[j]>0))
{ p=str[j];str[j]=str[i];str[i]=p;}
}
for(i=0;i<5;i++)
{cout<<str[i]<<endl;}
}