日期:2014-05-20 浏览次数:20699 次
public static void main(String[] args) { int [] b = new int[]{1}; Test t = new Test(); t.fun(b,9); } private void fun(int[] b, int count) { int[] a ; if(count ==0 ) return; if(count != 1){ for(int i =0;i<count-1;i++){ System.out.print(" "); } } for(int i =0;i<b.length;i++){ System.out.print(b[i] + " "); } System.out.println(); if(b.length ==1){ a = new int[]{1,1}; } else { a = new int[b.length +1]; a[0] = 1; for(int i = 1;i<b.length;i++){ a[i] = b[i-1]+b[i]; } a[b.length] =1; } b = null; fun(a,count-1); }