Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int a[100000];
  4. int main() {
  5. int n;
  6. cin >> n;
  7. int cnt = 0;
  8. do {
  9. ++cnt;
  10. a[cnt] = (n % 2) * 5;
  11. n = n / 2;
  12. } while (n > 1);
  13. a[++cnt] = n * 5;
  14. for (int i = cnt; i > 0; i--) {
  15. cout << a[i];
  16. }
  17. return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement