Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Pluralizer
- {
- class Program
- {
- static void Main(string[] args)
- {
- string noun = Console.ReadLine();
- if(noun.EndsWith('y'))
- {
- noun = noun.Remove(noun.LastIndexOf('y'));
- noun = noun.Insert(noun.Length, "ies");
- }
- else if(noun.EndsWith('o')||noun.EndsWith("ch")||noun.EndsWith("sh")||noun.EndsWith('x')||noun.EndsWith('z'))
- {
- noun = noun.Insert(noun.Length, "es");
- }
- else
- {
- noun = noun.Insert(noun.Length, "s");
- }
- Console.WriteLine(noun);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement