#include<stdio.h>
#include<string.h>
#define NUM 50
int main()
{
    void sort(char s[ ][6],int);
    int i,n;
    printf("please input n specific value:\n");
    scanf("%d",&n);
    char str[NUM][6];
   //数组长度是固定的,不能用变量来定义大小,只能预先分配一个比较大的空间
    printf("input n strings:\n");
    for(i=0;i<n;i++)
        scanf("%s",str[i]);
    sort(str,n);
    printf("now,the squence is :\n");
    for(i=0;i<n;i++)
               
        printf("%s\n",str[i]); 
    return 0;}
void sort(char s[][6],int n)
{
    int i,j;
    char *p,temp[6];
  //temp用来临时存储字符串,大小和s[0]长度相同
    p=temp;
    for(i=0;i<n-1;i++)
              
        for(j=0;j<n-1-i;j++)
            if(strcmp(s[j],s[j+1])>0)
            {
                strcpy(p,s[j]);
                strcpy(s[j],s[+j+1]);
                strcpy(s[j+1],p);
            }
}