因为这个问题比较简单,就不给详细解答,直接贴代码了 public class RodCut { public static void main(String[] args) { int [] price = { 0,1,5, 8,9,10,17,17,20,24,30,34,38,43,47,50,57,62,63,64,65,66,67,68,69,70, 71, 82}; final int num = price.length - 1; int