package com.itheima.d1_file; public class DiGui2 { public static void main(String[] args) { for (int i = 1;i<=10;i++){ for (int k = i;k<10;k++){ System.out.print("t"); } for (int j = 1;j<=i;j++){ System.out.print(f(j,i) + "tt"); } System.out.println(); } } public static int f(int y,int x){ if(y==1 || y == x){ return 1; } else { return f(y-1,x-1) + f(y,x-1); } } }
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)