📅  最后修改于: 2022-03-11 14:44:50.381000             🧑  作者: Mango
OK = false ;
while(!OK) {
in();
int t = k;
while(a[t] == n + t - k) t--;
if(t>0) {
a[t]++;
for(int i = t+1; i<= k ; i++) {
a[i] = a[i-1] +1;
}
} else OK = true;
}