填空题
下列给定程序中,函数fun的功能是:判断形参s所指字符串是否是“回文”(Palindrome),若是,函数返回值为1;若不是,函数返回值为0。“回文”是指正读和反读都一样的字符串(不区分大小写字母)。
例如,LEVEL和Level是“回文”,而LEVLEV不是“回文”。
请在程序的下划线处填入正确的内容,使程序得出正确的结果。
注意:部分源程序给出如下。
不得增行或删行,也不得更改程序的结构!
试题程序:
#include<stdio.h>
#include<string.h>
#include<ctype.h>
int fun(char *s)
{char *lp,*rp;
/********found********/
lp=
1;
rp=s+strlen(s)-1;
while((toupper(*lp)==toupper(*rp))&&(lp<rp))
{
/********found********/
lp++;rp
2;}
/*********found********/
if(lp<rp)
3;
else return 1;
}
main()
{char s[81];
printf("Enter a string:");
scanf("%s",s);
if(fun(s))printf("/n"%s"is a Palindrome./n/n",s);
else printf("/n"%s"isn"t a Palindrome./n/n",s);
}