0
Snail in the well problem not getting!
function main() { var depth = parseInt(readLine(), 10); //your code goes here var c=0; var sum=0; for (i=0;i>=depth;i+=sum) { sum=i+7-2; c++; } document.write(c); }
4 Antworten
+ 3
function main() {
var depth = parseInt(readLine(), 10);
var a = 0;
var day = 0
while(a <= depth) {
a += 7
day += 1
if (a >= depth) {
break;
}
a -= 2
}
console.log(day)
}
Try this code.
+ 1
thanks
+ 1
Jayanth😎 Welcome
0
I'm trying to get this code
It's working prop.