1 #include<stdio.h>
 2 #include<stdlib.h>
 3 #include<string.h>
 4 int IsPalindromes(char str[])
 5 {
 6     int i,len=strlen(str);
 7     for(i=0;i<len/2;i++)
 8     if(str[i]!=str[len-i-1])  return 0;
 9     return 1;
10 }
11 int main()
12 {
13     int n;
14     char str[1010];
15     scanf("%d%*c",&n);
16     while(n--)
17     {
18         gets(str);
19         puts(IsPalindromes(str)?"yes":"no");//puts包含了换行符 
20     }
21     system("pause");
22     return 0;
23 }

相关文章:

  • 2022-02-01
  • 2021-10-20
  • 2022-12-23
  • 2022-02-13
  • 2022-02-20
  • 2022-02-27
  • 2022-02-02
  • 2021-11-05
猜你喜欢
  • 2022-12-23
  • 2021-04-29
  • 2021-04-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案