#include <stdio.h>
  2 #include <string.h>
  3 #include <stdlib.h>
  4
  5 void sort(char *wilst[], int size){
  6     for(int i=0; i<=size; i++){
  7         if( strcmp (wilst[i], wilst[i+1] ) <0) {
  8             wilst[i] = wilst[i+1];
  9         }else{
 10              wilst[i+1] = wilst[i];
 11         }
 12
 13     }
 14
 15 }
 16 int main(){
 17
 18     char word[100];
 19     int numWords=0;
 20     char * word_list[100];
 21
 22     while(scanf("%s", word)!=EOF){
 23
 24             word_list[numWords] = (char *)malloc(strlen(word)+1);
 25                 strcpy(word_list[numWords],word);
 26                 numWords++;
 27
 28                 if(numWords>=100)
 29                     break;
 30
 31     }
 32
 33     sort(word_list, numWords);
 34
 35     for(int j=0; j<=numWords; j++){
 36         printf("%s\n", word_list[j]);
 37
 38     }
 39
 40     for(int n=0; n<numWords; n++){
 41         free(word_list[n]);
 42     }
 43
 44     return 0;
 45 }
 46
 47
~
~