📅  最后修改于: 2022-03-11 14:58:19.438000             🧑  作者: Mango
public class IntegerPartition {
static int count=0;
public static void partition(int n, int max) {
if (n == 0) {
count++;
return;
}
for (int i = Math.min(max, n); i >= 1; i--) {
partition(n - i, i);
}
}
public static void main(String[] args) {
partition(5,3);
System.out.println("Count: "+count);
}
}