Untitled
user_5811307
plain_text
8 months ago
303 B
0
Indexable
Never
#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); }
Leave a Comment