现在的位置: 首页 > 综合 > 正文

HDU 2051 – Bitset

2014年09月05日 ⁄ 综合 ⁄ 共 197字 ⁄ 字号 评论关闭

题目链接: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;
}

抱歉!评论已关闭.