`

现在有7 Kg的米,200g和50g的砝码,问用天平最少称几次可以称出1350g的米?如何用算法实现?

阅读更多
现在有7 Kg的米,200g和50g的砝码,问用天平最少称几次可以称出1350g的米?如何用算法实现?


1.200g and 50g   = 250g rice
2.200g and 250g rice = 50g + 400g rice  
now we have 250g rice and 400 rice,total 650g rice
3.650g rice and 50g =700g rice
now we have 650g rice and 700g rice,total 1350g rice.

算法:
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics