#define _CRT_SECURE_NO_WARNINGS #include<stdio.h> int main() { int i = 0; int num = 0; scanf("%d", &num); //10 //00000000000000000000000000001010 //打印奇数位 for (i = 30; i >=0; i-=2) { printf("%d ", (num >> i)&1); } printf("\n"); //打印偶数位 for (i = 31; i >= 1; i -= 2) { printf("%d ", (num >> i) & 1); } return 0; }