#include<stdio.h>
main()
{
int n;
scanf("%d",&n);
int A[33] = { 0 };
int i = 0;
while (n > 0)
{
A[i] = n % 2;
++i;
n /= 2;
}
int k = 0;
for (k = i-1; k >= 0; k--)
{
printf("%d", A[k]);
}
return 0;
}
【代码】二进制输出
于 2022-09-21 13:41:57 首次发布