+ 1

Snail in the well

What am I doing wrong?

11th Jan 2022, 11:49 PM
Alex Davis
Alex Davis - avatar
6 Réponses
+ 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