task We enter the n-th number of array elements. We derive the initial array and the maximum series of successive positive elements (ascending with step +1) [1,3,6,5,6,7,8,4,1,4,5] - > maximum series [5,6,7,8]
that's what happens with me
var mas=[]; do { mas.push(+prompt('ΠΠ²Π΅Π΄ΠΈΡΠ΅ ΡΠΈΡΠ»ΠΎ')) } while(mas[mas.length-1]!=0) mas.pop(); console.log(mas.join(" ")); var max=mas[0]; for (var i=0;i < mas.length;i++){ if(mas[i]>max) max=mas[i]; } console.log("ΠΠ°ΠΊΡΠΈΠΌΠ°Π»ΡΠ½ΡΠ΅ ΡΠΈΡΠ»Π° Π² ΠΌΠ°ΡΡΠΈΠ²Π΅ =",max); I can not figure out how to find out the series and select positive numbers from it ...