//10进制转2进制
int input = 12345;
int result[16];
for(int i = 0; i < 16; i++)
{
result[i] = input % 2;
input = input / 2;
std::cout << "10进制转2进制result ["<<i<<"]= "<< result[i] <<std::endl;
}
//2进制转10进制
input = 0;
for(int i = 0; i < 16; i++)
{
input = input + result[i] * pow(2, i);
}
std::cout << "2进制转10进制 input = "<< input <<std::endl;