C语言 回文

 1 #include <stdio.h>
 2 #include <string.h>
 3 int main()
 4 {
 5     char s[80];
 6     int i,j;
 7     printf("Please input the string:\n");
 8     gets(s);
 9     j=strlen(s)-1;
10     for(i=0;i<j;i++,j--)
11         if(s[i]!=s[j])
12             break;
13     if(i<j)
14         printf("No");
15     else
16         printf("Yes");
17     return 0;
18 }

 

posted @ 2017-01-04 12:04  JianFHe  阅读(893)  评论(0编辑  收藏  举报