给定程序MODl1.C中函数fun的功能是:从低位开始取出长整型变量s中奇数位上的数,依次构成一个新数放在t中。高位仍在高位,低位仍在低位。例如:当s中的数为2736598时,t中的数为:2358。
#include<conio.h>
#include<stdio.h>
/************found************/
void fun(long s,long t)
long s1=10;
*t=s%10;
while(s>0)
s=s/l00;
*t=S%10*s1+*t;
/************found************/
s1=s1*100;
main()
long s,t;
clrscr();
printf ("\nPlease enter s:");
scanf("%ld",&s);
fun(s,&t);
printf("The result is:%1d\n",t);