简体   繁体   中英

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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