Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _05._Word_in_Plural
- {
- class WordInPlural
- {
- static void Main(string[] args)
- {
- //Write a program, which receives a noun and prints the noun in plural.
- string word = Console.ReadLine();
- if (word.EndsWith('y'))
- {
- word = word.Remove(word.Length - 1);
- word = word + "ies";
- }
- else if (word.EndsWith('o') || word.EndsWith("ch") || word.EndsWith('s') || word.EndsWith("sh") || word.EndsWith('x') || word.EndsWith('z'))
- {
- word = word + "es";
- }
- else
- {
- word = word + "s";
- }
- Console.WriteLine(word);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment