#define M 7
#define N 11
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main() {
int i,k,j;
FILE *fp;
char str[M][N],sum=0,temp[N];
fp = fopen("D:\\test.txt","r");
i = 0;
while (fgets(str[i], 10, fp) != NULL)
i++;
printf("\n");
for (i = 0; i<M - 1; i++){
k = i;
for (j = i + 1; j < M; j++){
if (strcmp(str[k], str[j]) > 0) //把小的调上来
k = j;
}
if (k != i){
strcpy(temp, str[k]);
strcpy(str[k], str[i]);
strcpy(str[i], temp);
}
}
i =0;
while (i<M-1)
{
printf("%s", str[i]);
i++;
}
}