1 #include <stdio.h> 2 #include <string.h> 3 4 int main(int argc, char *argv[]) 5 { 6 char bin[8 * sizeof(int)]; 7 int n = 0; 8 int index; 9 10 scanf("%d", &n); 11 12 for(index = (8 * sizeof(int) - 1); index >= 0; index--) 13 { 14 bin[index] = (n & 1) + '0'; 15 n >>= 1; 16 } 17 18 bin[8 * sizeof(int)] = '\0'; 19 int i = 0; 20 21 for(index = 0; index <= (8 * sizeof(int) - 1); index++) 22 { 23 ++i; 24 putchar(bin[index]); 25 26 if(i % 4 == 0) 27 { 28 putchar(' '); 29 } 30 } 31 putchar('\n'); 32 33 return 0; 34 }