1 identify the fault
(1)
i>0 改为i >= 0
(2)
题设要求 last 0 in x
因此 将
for(int i = 0;i < x.length; i++)
变为
for(int i = x.length - 1; i >=0; i--)
2 非fault
(1)
x=null; y=10086;
(2)
x=null; y=10010;
3 fault 但非 error
(1)
x = [3,2,5]; y = 5;
(2)
x = [0,2,4];
4 error 但非fault
(1)
x = [2,3,5]; y=2;
(2)
x = [1];