7 条题解

  • 2
    @ 2018-12-15 08:53:47

    print((bin(int(input())))[2:])

  • 2
    @ 2017-10-12 09:00:48
    a=int(input())
    a=bin(a)
    print(a[2:])
    
  • 1
    @ 2017-10-17 16:51:01
    print (str(bin(int(input())))[2:])
    
  • 0
    @ 2020-07-24 12:13:08

    n=int(input())
    s=0
    y=0
    e=0
    m=0

    while n>=1:
    y=n%2
    n=n//2
    e=y*10**m+e
    m=m+1

    print(e)

  • 0
    @ 2019-05-17 19:08:24

    其实很简单,下面是代码,慢慢看吧
    ```cpp
    #include <iostream>

    std::string a = ""; //用string类型来保存数据

    int main()
    {
    unsigned long long n;
    std::cin >> n;
    unsigned int len = -1; //用来计数,下标从0开始,所以初始值为-1
    while (n != 0)
    {
    a += char(n % 2 + '0'); //把数变成字符存入字符串
    len++;
    n /= 2; //n每次除以2
    }
    while (len > 0) //逆向输出
    std::cout << a[len--];
    std::cout << a[len];
    std::cout << std::endl; //回车
    return 0;
    }
    ```

  • 0
    @ 2018-10-30 17:13:14
    #include <stdio.h>
    #include <iostream>
    using namespace std;
    int n,len,e;
    int a[64];
    int main()
    {
        cin>>n;
        while(n)
        {
            a[len++]=(n&1);
            n>>=1;
        }
        for(int i=len-1;i>=0;i--)
        {
            cout<<a[i];
        }
        return 0;
    }
    
  • -1
    @ 2017-10-12 09:01:14

    a=int(input())
    b=bin(a).replace('0b','')
    print(b)

  • 1

信息

难度
8
分类
(无)
标签
(无)
递交数
386
已通过
210
通过率
54%
被复制
1
上传者