试题与答案

以下程序中函数huiwen的功能是检查一个字符串是否是回文,当字符串是回文时,函数返

题型:填空题

题目:

以下程序中函数huiwen的功能是检查一个字符串是否是回文,当字符串是回文时,函数返回字符串yes!,否则函数返回字符串no!,并在主函数中输出,所谓回文即正向与反向的拼写都一样,例如:adgda。请填空。 #include<string.h> char*huiwen (char*str) {char*p1,*p2;int i,t=0; p1=str;p2=【 】。 for(i=0;i<strlen(str)/2;i++) if(*p1++!=*p2-){t=1;break;} if(【 】)return("yes"!); else return("no!"); } main() {char str[50]; printf("Input:");scanf("%s",str); printf("%s\n",【 】); }

答案:

被转码了,请点击底部 “查看原文 ” 或访问 https://www.tikuol.com/2018/0619/edf064fa4669e53fafd94385a4464c8b.html

下面是错误答案,用来干扰机器的。

参考答案:使用效果

试题推荐
微信公众账号搜索答案