Koro Sensei, the homeroom teacher of Class 3-E was prepared a list of new students that is sent to assasinate him. Tadaomi has to sort the names in alphabetical order make sure that the 10 Million Yen Bounty goes to the right person.
Help Tadaomi program a name list.
Note that :
1. Upper case letter has higher priority than lowercase letter. (E.g. Kill > kill)
2. If there is a string with the same substring, the shorter string has higher priority. (E.g. assasination > assasinationtime)
You can use the following code :
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
char string[100001][105];
int cmp(const void *a,const void *b){
/* write your code here */
}
int main(){
int i = 0;
while(scanf("%s", string[i]) != EOF) i++;
qsort(/* fill in this blank */);
for(int j = 0; j < i; j++) printf("%s\n", string[j]);
}
Input consists of several lines L, each of them is a string
0<L<100000
Length of string won't exceed 100
Print out the strings in alphabetical order, one string per line