题解 | #汽水瓶#
汽水瓶
http://www.nowcoder.com/practice/fe298c55694f4ed39e256170ff2c205f
var line='' while(line=readline()){ line=parseInt(line) var sum=0 if(line!==0){ while(line>=3){ var bottomCount=parseInt(line/3) sum+=bottomCount line=bottomCount+(line%3) } if(line===2) sum++ console.log(sum) }else{ break } }