Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let input = [2, 3, 1, 5, 6];
- let print = this.print || console.log;
- let gets = this.gets || ((arr, index) => () => arr[index++])(input, 0);
- let arr=[];
- for (i = 0; i < input.length; i++){
- arr.push(+gets());
- }
- let inputSort = arr.sort(function(a, b){return b-a});
- a="";
- for(i = 0; i < inputSort.length -1 ; i++){
- a += parseInt(inputSort[i]) + ", ";
- }
- print(a+ parseInt(inputSort[inputSort.length-1]));
Advertisement
Add Comment
Please, Sign In to add comment