2个回答
展开全部
#include"stdio.h"
#include"string.h"
#define n 50
void main()
{
int i;
char st1[n+1];
char *pst1,*pst2;
printf("please input a string:");
scanf("%s",st1);
pst1=st1;
pst2=st1;
while(*pst1!='\0')
pst1++;
i=0;
pst1--;
while(*pst1==*pst2 )
{
pst1--;
pst2++;
i++;
}
if(i==strlen(st1))
printf("yes\n");
else
printf("no\n");
}
终于是自己写的>>
#include"string.h"
#define n 50
void main()
{
int i;
char st1[n+1];
char *pst1,*pst2;
printf("please input a string:");
scanf("%s",st1);
pst1=st1;
pst2=st1;
while(*pst1!='\0')
pst1++;
i=0;
pst1--;
while(*pst1==*pst2 )
{
pst1--;
pst2++;
i++;
}
if(i==strlen(st1))
printf("yes\n");
else
printf("no\n");
}
终于是自己写的>>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询