简体   繁体   English

井中的蜗牛 - 单人学习项目

[英]The Snail in the Well - Solo learn project

In a way of trying to solve the 23 code project of SOLOLEARN JavaScript course known widely with (The Snail in the Well).. I produced this code which is worked with case of input = 128 and failed with input = 42. What I should modify in the code to implement the code successfully for all cases.在尝试解决 SOLOLEARN JavaScript 课程的 23 个代码项目(井中的蜗牛)广为人知的一种方式中。我生成了这个代码,它在输入 = 128 的情况下工作并且输入 = 42 失败。我应该做什么修改代码以在所有情况下成功实现代码。

function main() {
var depth = parseInt(readLine(), 10);
//your code goes here

let count=0
for( let i=0;i<depth;){
    i+=5
    count++
}
console.log(count)

} }

Please share with us the problem or the challenge, in order to see the full picture.请与我们分享问题或挑战,以查看全貌。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM