Palindromes _easy version
Total Submission(s): 36978 Accepted Submission(s): 22420
4 level abcde noon haha
yes no yes no
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
char str[10000]={0};
int sub(int m,int n)
{
if (m<=n)
if (str[m]==str[n])
return (sub(m+1,n-1));
else
return 0;
else
return 1;
}
int main()
{
int len=0,n=0;
char rub;
scanf("%d%c",&n,&rub);
while (n--)
{
gets(str);
printf ("%s\n",sub(0,strlen(str)-1)==1?"yes":"no");
memset(str,0,sizeof(str));
}
}
3091



被折叠的 条评论
为什么被折叠?



