回文判断

 1 #include<stdio.h>
 2 #include<string.h>
 3 int main()
 4 {
 5     char a[170];
 6     int i,j;
 7     while(gets(a)&&strcmp(a,"2013")!=0)
 8     {
 9         i=0;
10         while(a[i]!='')
11         {
12             if(a[i]==' ')
13             {
14                 j=i;
15                 while(a[j]!='')
16                 {
17                     a[j]=a[j+1];
18                     j++;
19                 }
20 
21             }
22             else i++;
23         }
24         int len=strlen(a);
25         for(i=0;i<strlen(a);i++)
26         {
27             if(a[i]!=a[strlen(a)-1-i])
28             break;
29         }
30         if(i>=strlen(a)/2)
31         printf("YES
");
32         else printf("NO
");
33     }return 0;
34 }
原文地址:https://www.cnblogs.com/wlc297984368/p/3250282.html