例如,形参s所指的字符串为:Abc@1x56*,程序执行后t所指字符数组中的字符串应为:A@156*。
请在程序的下划线处填入正确的内容并把下划线删除, 使程序得出正确的结果。
注意:源程序存放在考生文件夹下BLANK1.C中。
不得增行或删行,也不得更改程序的结构!
给定源程序:
#include
int fun(char *s, char *t)
{int n=0;
while(*s)
{if(*s < 97) {
/**********found**********/
*(t+n)= __1__ ; n++;}
/**********found**********/
__2__ ;
}
*(t+n)=0;
/**********found**********/
return __3__ ;
}
main()
{char s[81],t[81]; int n;
printf("\nEnter a string:\n"); gets(s);
n=fun(s,t);
printf("\nThere are %d letter which ASCII code is less than 97: %s\n",n,t);
}
解题答案:
/*********第一空*********/
*(t+n)= *s ; n++;}
/**********第二空**********/
s++ ;
/**********第三空**********/
return n ;
******************************************
相关专题:
编辑推荐: