Elementary Pluralizer

0

0 votes
Brute Force
Problem

Problem Description

You task is to create an elementary pluralizer program that takes several nouns in singular form then outputs their plural format using the incomplete set of rules below.

  1. If the noun ends with ch, x, s or o it's plural format is created by adding es.
    Examples: witch -> witches, tomato -> tomatoes
     
  2. If a singular noun ends with f or fe, the plural form is created by substituting ves.
    Examples: leaf -> leaves, knife -> knives
     
  3. Singular nouns ending with y change y to ies.
    Example: family -> families
     
  4. For all other instances, the plural is formed by adding s.
    Examples: book -> books, stone -> stones

Input Format

The first line of input contains a single positive integer n where 1n10 followed by n lines containing one word each. 

Output Format

Print the given n words in their plural forms on separate lines in the same order as was given in the Input

Time Limit: 1
Memory Limit: 256
Source Limit:
Editor Image

?