Advertisement
DAtanasova

words

May 26th, 2017
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. using System;
  2. class Program
  3. {
  4. static void Main()
  5. {
  6. string word = Console.ReadLine();
  7. bool endword = word.EndsWith("y");
  8. bool endword2 = word.EndsWith("o") || word.EndsWith("s")|| word.EndsWith("x") || word.EndsWith("z")|| word.EndsWith("ch") || word.EndsWith("sh");
  9. if (endword)
  10. {
  11. int removeletter = word.Length - 1;
  12. word = word.Remove(removeletter, 1);
  13. Console.WriteLine($"{word}ies");
  14. }
  15. else if (endword2)
  16. {
  17. Console.WriteLine($"{word}es");
  18. }
  19. else
  20. {
  21. Console.WriteLine($"{word}s");
  22. }
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement