daily pastebin goal
40%
SHARE
TWEET

Untitled

a guest Jan 29th, 2018 46 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2.  
  3. namespace _05.Word_in_plural
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string noun = Console.ReadLine();
  10.  
  11.            
  12.             if (noun.EndsWith("y"))
  13.             {
  14.                 noun = noun.Remove(noun.Length-1);
  15.                 noun = noun + "ies";
  16.             }
  17.             else if (noun.EndsWith("o")|| noun.EndsWith("ch")||noun.EndsWith("s")||noun.EndsWith("sh")|| noun.EndsWith("x") || noun.EndsWith("z") )
  18.             {
  19.                 noun = noun + "es";
  20.             }
  21.             else
  22.             {
  23.                 noun = noun + 's';
  24.             }
  25.             //bool temp = noun.EndsWith('y');
  26.  
  27.            
  28.  
  29.             Console.WriteLine(noun);
  30.  
  31.  
  32.  
  33.         }
  34.     }
  35. }
RAW Paste Data
Pastebin PRO WINTER Special!
Get 40% OFF Pastebin PRO accounts!
Top