发布网友 发布时间:2024-09-27 09:06
共1个回答
热心网友 时间:2024-09-28 06:36
#include <stdio.h>
#include <string.h>
int main()
{
char a[100];
int i = 0;
scanf("%s",a);
int len = strlen(a);
bool huiwen = 0;
while(i< len/2)
{
if(a[i] == a[len - i-1])
{
huiwen = 1;
}
else
{
huiwen = 0;
break;
}
i++;
}
if(huiwen)
{
printf("YES");
}
else
{
printf("NO");
}
return 0;
}
热心网友 时间:2024-09-28 06:40
#include <stdio.h>
#include <string.h>
int main()
{
char a[100];
int i = 0;
scanf("%s",a);
int len = strlen(a);
bool huiwen = 0;
while(i< len/2)
{
if(a[i] == a[len - i-1])
{
huiwen = 1;
}
else
{
huiwen = 0;
break;
}
i++;
}
if(huiwen)
{
printf("YES");
}
else
{
printf("NO");
}
return 0;
}