Untitled
user_5811307
plain_text
2 years ago
303 B
8
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