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