Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //test2
- #include <iostream>
- #include <vector>
- #include <algorithm>
- using namespace std;
- int main(void) {
- freopen("input.txt", "r", stdin);
- freopen("output.txt", "w", stdout);
- int n;
- vector<int> a(0);
- cin >> n;
- while (n != 0) {
- a.push_back(n % 2);
- n >>= 1;
- }
- reverse(a.begin(), a.end());
- for (int i = 0; i < a.size(); ++ i)
- cout << a[i];
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement