3289 - EE2310 Week 14 Practice Scoreboard

Time

2025/12/08 12:30:00 2025/12/31 23:59:00

Clarification

# Problem Asker Description Reply Replier Reply Time For all team

# Problem Pass Rate (passed user / total user)
14877 Custom English Word Sorting

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:

  1. A shorter word appears before a longer word.

  2. If two words have the same length, then the word with fewer uppercase letters appears before the one with more uppercase letters.

  3. 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.

  4. 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

Sample Input  Download

Sample Output  Download




Discuss