功能是:依次取出正长整型变量s中偶数位上的数,构成一个新数放在t中

问题描述:

功能是:依次取出正长整型变量s中偶数位上的数,构成一个新数放在t中
#include
void fun(long s,long t)
{
long s1=10;
s/=10;
*t=s/10;
while(s0)
{
fun(s,&t);
printf("%ld\n",t);
}
else
printf("s value error\n");
}
1个回答 分类:综合 2014-12-13

问题解答:

我来补答
void main()
{
long s,t=0;
scanf("%ld",&s);
if(s>0)
{
fun(s,&t);
printf("%ld\n",t);
}
else
printf("s value error\n");

}
void fun(long s,long *t)
{
long s1=1;
while(s>0)
{
s = s/10;
*t = s%10 * s1 + *t;
s /= 10;
s1 *= 10;
}
}
 
 
展开全文阅读
剩余:2000
下一页:生物 酶