回文判断
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>
int my_strlen(char b[])
{
int i = 0;
int z = 0;
while (b[i] != '\0')
{
z++;
i++;
}
return z;
}
int main()
{
char a[20];
fgets(a, 100, stdin);
int count =my_strlen(a);
int d = 0;
int left= 0;
int right = count - 2;//输入回车会占用一个字符,所以要多减一个1
while (left < right)
{
if (a[left] != a[right])
{
d = 1;
}
left++;
right--;
}
if (d == 1)
printf("NO");
else
printf("YES");
return 0;
}