/
P05_WordInPlural.cs
34 lines (31 loc) · 938 Bytes
/
P05_WordInPlural.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
using System;
namespace P05_WordInPlural
{
class P05_WordInPlural
{
static void Main(string[] args)
{
string word = Console.ReadLine();
bool isEndingY = word.EndsWith("y");
bool isEnd_o_ch_s_sh_x_z = word.EndsWith("o") ||
word.EndsWith("ch") ||
word.EndsWith("s") ||
word.EndsWith("sh") ||
word.EndsWith("x") ||
word.EndsWith("z");
if (isEnd_o_ch_s_sh_x_z)
{
word += "es";
}
else if (isEndingY)
{
word = word.Remove(word.Length - 1) + "ies";
}
else
{
word += "s";
}
Console.WriteLine(word);
}
}
}