填空题
给定的程序中,fun函数的功能是:将s所指字符串中除了下标为偶数,同时ASCH值为偶数的字符除外,其余的全部删除;串中剩余字符所形成的一个新串放在t所指的数组中。如:若s所指字符串中的内容为:”desktop12345",t所指字符串中的内容为:"dtp24"。
请在程序的下划线处填写正确的内容,使程序得到正确的结果。
#inClUde <conio.h>
#include <stdio.h>
#include <string.h>
void fun (Char *s,char t[])
{
int i,j;
for(i=0,j=0; (1) ;i++)
if(i%2==0&&s[i]%2==0) (2) ;
(3) ;
}
main()
{ char s[100],t[100];
clrscr();
printf("\nPlease enter string S:");
scanf("%s",s);
fun(s,t);
printf("\n The result is:% s\n",t);
NONO();/*本函数与考生答题无关,考生不得改动,否则后果自负。*/
}
【参考答案】
void fun(char *s,char t[])