lxliio的博客
lxliio · 共 1 篇文章
生成{1,2,..n}的字典序r-组合算法
public static void main(String[] args) throws IOException { int[] inputArray = {1, 2, 3, 4, 5, 6, 7, 8}; int[] temp = {1,2,3,4}; int total = 0; while(true){ int change = temp.length-1; for(int i=0; i<temp.length; i++){ if(temp[i] == inputArray[inputArray.length-temp.length+i]){ change = i-1; break;…
2013-12-02T16:15:36Z · 编程语言 · 评论(0)