问答题
编号:2482992
给定程序中,函数fun的功能是:将形参n所指变量中,各位上为偶数的数去除,剩余的数按原来从高位到低位的顺序组成一个新的数.并通过形参指针n传回所指变量。
例如输入一个数:27638496,新的数:为739。
请在程序的下划线处填八正确的内容并把下划线删除,使程序得出正确的结果。 注意:源程序存放在考生文件夹下的BLANKl.C中。
不得增行或删行,也不得更改程序的结构!
/**********code.c**********/
#include <stdio.h>
void fun(unsigned long *n)
{
unsigned long x=0, i; int t;
i=1;
while(*n)
{
/**********found**********/
t=*n % __1__;
/**********found**********/
if(t%2!= __2__)
{ x=x+t*i; i=i*10; }
*n =*n /10;
}
/**********found**********/
*n=__3__;
}
main()
{
unsigned long n=-1;
while(n>99999999||n<0)
{ printf("Please input(0<n<100000000): "); scanf("%ld",&n); }
fun(&n);
printf(" The result is: %ld ",n);
}
/**********-code.c**********/