let a = prompt('请输入纸张厚度'); let b = prompt('请输入物体高度'); let c = 0 ; function d (a,b){ while ( a < b ){ a = a * 2; c = c + 1 ; if(a > b ){ console.log(c); } } } d(a,b);
let a = prompt('请输入纸张厚度'); let b = prompt('请输入物体高度'); let c = 0 ; function d (a,b){ while ( a < b ){ a = a * 2; c = c + 1 ; if(a > b ){ console.log(c); } } } d(a,b);