#include<stdio.h>
void f(long x)
{if(x<100) printf(“%d”,x/10);
else
{f(x/100);
printf(“%d”,x%100/10);}
}
main()
{f(123456);}
答案是135,请教高手是如何算出来。谢谢。
>> 本文固定链接: http://www.vcgood.com/archives/2106
#include<stdio.h>
void f(long x)
{if(x<100) printf(“%d”,x/10);
else
{f(x/100);
printf(“%d”,x%100/10);}
}
main()
{f(123456);}
答案是135,请教高手是如何算出来。谢谢。
>> 本文固定链接: http://www.vcgood.com/archives/2106
你必须先 登录才能发表评论。
The function f(long x) works like:
f(12);/* output 1 */
printf(“%d”,1234%100/10);/* output 3 */
printf(“%d”,123456%100/10);/* output 5 */
Well, I hope it’s helpful.
Please consider it carefully.