c
#include<stdio.h>
int main()
{
int i , j , n = 0 ;
int judge ;
char let[100] , ir[n] ;
gets( let ) ;
for ( i = 0; i < 100; i++)
{
if ( let[i] == '\0') break ;
n += 1 ;
}
for ( i = n - 1 , j = 0 ; i >= 0 , j < n ; i--,j++ )
ir[j] = let[i] ;
for ( i = 0; i < n ; i++ )
{
if( ir[i] == let[i] )
judge = 1 ;
else
judge = 0 ;
}
if( judge == 1 )
printf("该字符串是回文") ;
else
printf("该字符串不是回文") ;
return 0;
}
输入sadfsd23wfasd
在其它编译器上都没问题,只有在头歌平台上测试不正确