Advertisement
Guest User

Untitled

a guest
May 20th, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.66 KB | None | 0 0
  1. using System;
  2.  
  3. namespace ConsoleApp4
  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, 1) + "ies";
  14.  
  15.             }
  16.             else if (word.EndsWith('o') ||
  17.               word.EndsWith("ch") || word.EndsWith('s') ||
  18.               word.EndsWith("sh") || word.EndsWith('x') ||
  19.               word.EndsWith('z')) ;
  20.             {
  21.                 word += "es";
  22.             }else {
  23.                 word += "s";
  24.             }
  25.             Console.WriteLine(word);
  26.         }
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement