<pre name="code" class="html">------<a href="http://www.itheima.com" target="blank">Java培训、Android培训、iOS培训、.Net培训</a>、期待与您交流! -------
void printfBinary(int number);
int main()
{
printfBinary(12);
return 0;
}
void printfBinary(int number)
{ //记录现在挪到第几位
int temp=31;
while (temp>=0)
{
int value = (number>>temp&1);
printf("%d",value);
temp--;
if ((temp+1)%4==0)
{
printf(" ");
}
}
printf("\n");
}