#include<stdio.h>
#define N 100
int main()
{
int n, a[N];
int i = 0;
printf("请输入十进制数n:");
scanf("%d", &n);
while (n>0)
{
a[i] = n % 2;
i = i + 1;
n = n / 2;
}
while(i>=0)
{
printf("%d", a[i]);
i - -; //i--是因为,存的时候是从低位到高位,而输出应该从最高位开始输
}
printf("\n");