Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include<cstring>
- #include <vector>
- #include <cstdlib>
- #include <sstream>
- using namespace std;
- int
- main ()
- {
- vector < int >a (40);
- int t = 0;
- int y, x;
- cin>>x;
- for (int i=0;i<40;i++) a[i] = 0;
- do
- {
- y = x % 10;
- do
- {
- t = t + 1;
- a[t] = y % 2;
- y = y / 2;
- }
- while (y != 0);
- if (t % 4 != 0)
- t = t + 4 - t % 4;
- x = x / 10;
- }
- while (x != 0);
- do
- {
- // itoa(a[t],res1,10);
- cout << a[t];
- t = t - 1;
- }
- while (t != 0);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement