diff --git a/460 Plural Form of Nouns/99999460.cpp b/460 Plural Form of Nouns/99999460.cpp new file mode 100644 index 0000000..f27522b --- /dev/null +++ b/460 Plural Form of Nouns/99999460.cpp @@ -0,0 +1,72 @@ +#include +using namespace std; + +#define ll long long +#define ul unsigned long long +#define pb push_back +#define ss second +#define ff first +#define fr(m) for(int i=0; i=0; --i) +#define nl '\n' +#define yes cout<<"YES"<>s; + int sz=s.size(); + char last=s[sz-1]; + char s_last=s[sz-2]; + if((s_last=='c' && last=='h') || last=='x' || last=='s' ||last=='o') + s=s+"es"; + else if(last=='f') + { + s.pop_back(); + s=s+"ves"; + } + else if(s_last=='f' && last=='e') + { + s.pop_back(); + s.pop_back(); + s=s+"ves"; + } + else if(last=='y') + { + s.pop_back(); + s=s+"ies"; + } + else + { + s=s+"s"; + } + cout<> TC; + while (TC--) solve(); +} \ No newline at end of file