Advertisement
Guest User

Untitled

a guest
Feb 19th, 2020
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. const input = ['236476736'];
  2. const print = this.print || console.log;
  3. const gets = this.gets || ((arr, index) => () => arr[index++])(input, 0);
  4. let decimal = gets();
  5. let binary = '';
  6. while (decimal > 0) {
  7. binary = (decimal % 2) + binary;
  8. decimal = Math.floor(decimal / 2);
  9.  
  10. }
  11. print(binary);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement