用数组的方式10进制转换2进制
#include<stdio.h>int main(){ int count=0,i,j,k; int n; int a[16]={0}; printf("请输入想转换的数:\n"); scanf("%d",&n); do { a[count++]=n%2; n=n/2; }while(n); printf("二进制数为: