#include <iostream>
#include <string>
#include <vector>
#include <algorithm>

using namespace std;

void toBit(int n)
{
    vector<int> vec;
    while (n > 0)
    {
        if (n % 2 == 0)
        {
            vec.push_back(0);
        }
        else
        {
            vec.push_back(1);
        }
        n /= 2;
    }
    for (int i = vec.size() - 1; i >= 0; i--)
    {
        cout << vec[i];
    }
    cout << endl;

}

int main()
{
    int n;
    while (cin >> n)
    {
        toBit(n);
    }
}

 

相关文章:

  • 2022-02-22
  • 2021-12-03
  • 2022-12-23
  • 2021-06-06
  • 2021-09-18
  • 2022-12-23
  • 2021-05-16
猜你喜欢
  • 2021-11-12
  • 2021-11-12
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案