# include "stdio.h" int main(viod) { int d[30],i=0,n; printf("请输入整数:"); scanf("%d",&n); while(n>0) { d[i++]=n%2; n=n/2; } printf("转换为二进制为:"); for(i--;i>=0;i--) printf("%d",d[i]); printf("\n"); }