首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 其他相关 >

算法题一

2013-03-27 
算法题1?运行:@Testpublic void testNumber() {Number quenew Number(10)que.getBottom() }?结果如下:?

算法题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]]

?

?

?

热点排行