原创
版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。
直接上代码
import java.util.Iterator; import java.util.TreeSet; public class Hongbao {	private final int[] moneyList;	private final int number;	private final int totalMoney;	private int cur;	public Hongbao(int number, int totalMoney) {	if (number > totalMoney)	throw new IllegalArgumentException("numbermoneySet = new TreeSet