Snail in the well | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Snail in the well

What am I doing wrong?

11th Jan 2022, 11:49 PM
Alex Davis
Alex Davis - avatar
4 Answers
+ 1
Not a problem was trying to figure out how to grab it.
11th Jan 2022, 11:53 PM
Alex Davis
Alex Davis - avatar
0
I tried using while
11th Jan 2022, 11:49 PM
Alex Davis
Alex Davis - avatar
0
So i put two vars, and then a while statement of s<depth and told it to do s=s+7-2 Days++ but it says it timed out.
11th Jan 2022, 11:51 PM
Alex Davis
Alex Davis - avatar
0
function main() { var depth = parseInt(readLine(), 10); //your code goes here var s=0; var days=0 ; while (s<=depth) ; { document.write(days); s=s+7-2 ; days++ ;} { console.log(days); } }
11th Jan 2022, 11:53 PM
Alex Davis
Alex Davis - avatar