Klalchev

Untitled

Apr 3rd, 2020
600
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. let input = [1, 2, 3];
  2.  
  3.   let print = this.print || console.log;
  4.   let gets = this.gets || ((arr, index) => () => arr[index++])(input, 0);
  5.  
  6. let arr=[];
  7. for (i=0; i<input.length;i++){
  8. arr.push(+gets());
  9. }
  10.  
  11. let inputSort=arr.sort(function(a, b){return b-a});
  12. a="";
  13.  
  14.  
  15. for(i=0;i<inputSort.length-1;i++){
  16. a += parseInt(inputSort[i]) + ", ";
  17. }
  18. print(a+ parseInt(inputSort[inputSort.length-1]));
Advertisement
Add Comment
Please, Sign In to add comment