+ 1

"Trip Planner" in JS isn't accepting my code, can anyone help?

"Trip Planner" in JS isn't accepting my code. Here is my code => function main() { var distance = parseInt(readline(), 10); var speed = 40; var time = distance/speed; var ans = time*60; console.log(ans); return; } main()

27th Jun 2021, 2:58 AM
Anshuman Singh
Anshuman Singh - avatar
1 Réponse
+ 11
L should be uppercase in readLine() No need to call main() since it's done by compiler itself function main() { var distance = parseInt(readLine(), 10); var speed = 40; var time = distance/speed; var ans = time*60; console.log(ans); // return; } //main()
27th Jun 2021, 3:19 AM
Simba
Simba - avatar