Advertisement
Liliana797979

moeto viarno reshenie skeleton

Feb 20th, 2021
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function skeleton(input) {
  2.     let minutes = Number(input[0]);
  3.     let seconds = Number(input[1]);
  4.     let chuteLengthMetres = Number(input[2]);
  5.     let secondsInMetres = Number(input[3]);
  6.  
  7.     let secondsControl = minutes * 60 + seconds;
  8.     let time = chuteLengthMetres / 120;
  9.     let totalTime = time * 2.5;
  10.     let timeMarin = (chuteLengthMetres / 100) * secondsInMetres - totalTime;
  11.  
  12.     if (timeMarin <= secondsControl) {
  13.         console.log(`Marin Bangiev won an Olympic quota!`);
  14.         console.log(`His time is ${timeMarin.toFixed(3)}.`);
  15.     } else {
  16.         console.log(`No, Marin failed! He was ${Math.abs(secondsControl - timeMarin).toFixed(3)} second slower.`);
  17.     }
  18. }
  19.  
  20. skeleton(["2",
  21. "12",
  22. "1200",
  23. "10"])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement