Advertisement
CR7CR7

MaxNumber

Feb 9th, 2022
695
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. let input =[3,
  2.     1,
  3.     2,
  4.     3,
  5. ];
  6. let print = this.print || console.log;
  7. let gets = this.gets || ((arr, index) => () => arr[index++])(input, 0);
  8.  
  9.  
  10.  
  11. const n =+gets();
  12. let maxValue = 0;
  13. for(let i=0; i <= n;i++){
  14. let number =+gets();
  15. if(number >= maxValue){
  16.     maxValue=number;
  17. }
  18.  
  19. }
  20. print(maxValue);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement