Problem H: 零起点学算法109——单数变复数

时间:2021-08-09 03:17:06
#include <stdio.h>
#include<string.h>
int main(void)
{
int n;
char word[];
scanf("%d",&n);
getchar();
int i;
while(n!=)
{
gets(word);
int k=strlen(word);
if(word[k-]=='y')
strcat(word,"es");
else if(word[k-]=='s'||word[k-]=='x')
strcat(word,"es");
else if(word[k-]=='s'&&word[k-]=='h')
strcat(word,"es");
else if(word[k-]=='c'&&word[k-]=='h')
strcat(word,"es");
else if(word[k-]=='o')
strcat(word,"es");
else
strcat(word,"s");
puts(word);
n--;
}
return ;
}

似乎用printf提交ac不了,用put可以