| # | Problem | Pass Rate (passed user / total user) |
|---|---|---|
| 14877 | Custom English Word Sorting |
|
Description
Write a program to sort n English words. An English word is defined as a sequence of at most m English letters. The ordering between English words must follow the rules below:
-
A shorter word appears before a longer word.
-
If two words have the same length, then the word with fewer uppercase letters appears before the one with more uppercase letters.
-
If two words have the same length and the same number of uppercase letters, then the word with fewer vowels appears before the word with more vowels.
Vowels include both uppercase and lowercase a, e, i, o, u. -
If the order is still undecided, use
strcmp().
The ordering must follow the rules above.
Parameter constraints:
0 < n ≤ 100000, 0 < m ≤ 80
Input
You are given n lines of input, each containing one English word.
The program must process all input until EOF.
Since n can be very large, please use qsort, not bubble sort.
Ex. This
Book
Keep
is
not
a
book
Output
Your output should contain n lines, each with one English word.
Ex. a
is
not
book
This
Book
Keep