import java.util.Scanner;
public class Kehou03 {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner input=new Scanner(System.in);
System.out.println("请问你要打印几行杨辉三角?");
int n=input.nextInt();//定位二维数组;
int[][]yanghui =new int[n][n];//换行赋值
for(int i=0;i<n;i++){
yanghui[i][0]=1;
for(int j=1;j<=i;j++){
if(i==j){
yanghui[i][j]=1;
}else{
yanghui[i][j]=yanghui[i-1][j]+yanghui[i-1][j-1];
}
}
}//输出数组中的值
for(int i=0;i<n;i++){
for(int j=0;j<=i;j++){
System.out.print(yanghui[i][j]+"\t");
}
System.out.println();
}
}
}
public class Kehou03 {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner input=new Scanner(System.in);
System.out.println("请问你要打印几行杨辉三角?");
int n=input.nextInt();//定位二维数组;
int[][]yanghui =new int[n][n];//换行赋值
for(int i=0;i<n;i++){
yanghui[i][0]=1;
for(int j=1;j<=i;j++){
if(i==j){
yanghui[i][j]=1;
}else{
yanghui[i][j]=yanghui[i-1][j]+yanghui[i-1][j-1];
}
}
}//输出数组中的值
for(int i=0;i<n;i++){
for(int j=0;j<=i;j++){
System.out.print(yanghui[i][j]+"\t");
}
System.out.println();
}
}
}