#include
using namespace std;
int rjz (int x)
{
int y,z,o1,o2,o3,o4,o5,o6;
o1=x/100000;
o2=(x/10000)%10;
o3=(x/1000)%10;
o4=(x/100)%10;
o5=(x/10)%10;
o6=x%10;
y=o6+o5*2+o4*2*2+o3*2*2*2+o2*2*2*2*2+o1*2*2*2*2*2;
return (y);
}
int main (void)
{
cout<<rjz (010000)<<endl;
}
请问一下为什么我子函数单独可以运行出正确结果,我的放到主函数里面就不行了。就比如我这个程序输出的就是56。(这个是我自己编的二进制转十进制)