算法题1
?运行:
@Testpublic void testNumber() {Number que=new Number(10);que.getBottom(); }?结果如下:
?
初始bottom:[success=false,bottom=[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]
?
修正1次得到结果:[success=false,bottom=[10, 0, 0, 0, 0, 0, 0, 0, 0, 0]]
?
修正2次得到结果:[success=false,bottom=[9, 0, 0, 0, 0, 0, 0, 0, 0, 1]]
?
修正3次得到结果:[success=false,bottom=[8, 1, 0, 0, 0, 0, 0, 0, 1, 0]]
?
修正4次得到结果:[success=false,bottom=[7, 2, 1, 0, 0, 0, 0, 1, 0, 0]]
?
修正5次得到结果:[success=false,bottom=[6, 2, 1, 0, 0, 0, 1, 0, 0, 0]]
?
修正6次得到结果:[success=true,bottom=[6, 2, 1, 0, 0, 0, 1, 0, 0, 0]]
?
?
?