Re: [讨论] 面试遇到的考题

楼主: dlikeayu (太阳拳vs野球拳)   2014-07-04 02:50:27
从肛门开始做事算吗?
var x = [2 , -7 , 0 , 2 , 3 , 8 , -6 , 5],
y = x.length -2,
z = 0;
do {
var f = x.pop() * x[y];
if (f > 0)
{
x.pop();
x.push(f);
if (f > z)
{
z = f;
}
}
}
while (y

Links booklink

Contact Us: admin [ a t ] ucptt.com