#include<stdio.h> int main() { int n; int a[11]; int len; while(~scanf("%d",&n)) { len = 0; while(n!=0) { if(n%2==0) a[len++] = 0; else a[len++] = 1; n /= 2; } while(len--) printf("%d",a[len]); printf(" "); } return 0; }
说明:
1. 求二进制