Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function skeleton(input) {
- let minutes = Number(input[0]);
- let seconds = Number(input[1]);
- let length = Number(input[2]);
- let secondsPer100M = Number(input[3]);
- let contrSeconds = minutes * 60 + seconds;
- let timeForLength = length / 100 * secondsPer100M;
- let timeSlowing = length / 120 * 2.5;
- let time = timeForLength - timeSlowing;
- if (time <= contrSeconds) {
- console.log(`Marin Bangiev won an Olympic quota!`);
- console.log(`His time is ${time.toFixed(3)}.`);
- } else {
- console.log(`No, Marin failed! He was ${Math.abs(contrSeconds - time).toFixed(3)} second slower.`);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment