Untitled

 avatar
user_5811307
plain_text
a year ago
303 B
3
Indexable
#include <iostream>
#include <cmath>
#include <string>
using namespace std;

void g(int a)
{
    string gg = "";
    while (a != 0)
    {
        gg.push_back(a%2 + '0');
        a = int(a/2);

    }
    reverse(gg.begin(), gg.end());
    cout << gg;
}

int main()
{
    int a;
    cin >> a;
    g(a);
}
Editor is loading...
Leave a Comment