软件测试 homework2

(1)for循环中i>0应改为i>=0

   x = [ 3 2 5],y = 2

   x = [ 3 4 5],y = 2

   x = [  2 ],y = 2

(2)for 循环中应改为for(i = x.length -1 ; i >= 0; i--)

   x = [  0 2 ]

   x = [  2 0 0]

   x = [  0 ] 

原文地址:https://www.cnblogs.com/hersenxiao/p/5248354.html