Advertisement
martinvalchev

Word_in_Plural

Jan 28th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.70 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Word_in_Plural
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string word = Console.ReadLine();
  10.            
  11.             if (word.EndsWith("y"))
  12.             {
  13.                 word = word.Remove(word.Length - 1);
  14.                 word = word + "ies";
  15.             } else if (word.EndsWith("o") || word.EndsWith("ch") || word.EndsWith("s") || word.EndsWith("sh")
  16.                 || word.EndsWith("x") || word.EndsWith("z"))
  17.             {
  18.                 word = word + "es";
  19.             } else
  20.             {
  21.                 word = word + "s";
  22.             }
  23.             Console.WriteLine(word);
  24.  
  25.             }
  26.         }
  27.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement