void plural(string s) { int n = s.length(); if (s.back() == 'y') cout << s.substr(0, n-1) << "ies"; else if (s.back() == 's' || s.back() == 'x') cout << s << "es"; else if (s.substr(n-2) == "sh" || s.substr(n-2) == "ch") cout << s << "es"; else if (s.substr(n-3) == "man") cout << s.substr(0, n-3) << "men"; else cout << s << 's'; }