题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2051
#include <stdio.h> void TtoB(int n) { if (n) { TtoB(n >> 1); printf("%d", n & 1); } } int main(void) { int n; while (scanf("%d", &n) != EOF) { TtoB(n); putchar('\n'); } return 0; }
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2051
#include <stdio.h> void TtoB(int n) { if (n) { TtoB(n >> 1); printf("%d", n & 1); } } int main(void) { int n; while (scanf("%d", &n) != EOF) { TtoB(n); putchar('\n'); } return 0; }