Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- int main()
- {
- int t;
- scanf("%d", &t);
- while (t--)
- {
- char s[150];
- scanf("%s", s);
- int n = (int)strlen(s);
- if(s[n-1]=='y')
- {
- s[n-1]='i';
- s[n]='e';
- s[n+1]='s';
- }
- else if(n>1 and s[n-1]=='e' and s[n-2]=='f')
- {
- s[n-2]='v';
- s[n-1]='e';
- s[n]='s';
- }
- else if(s[n-1]=='o' or s[n-1]=='s' or s[n-1]=='x' or (s[n-1]=='h' and s[n-2]=='c'))
- {
- s[n-1]='e';
- s[n]='s';
- }
- else
- {
- s[n]='s';
- }
- puts(s);
- printf("\n");
- memset(s, 0, 150);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement