import java.io.*;
public class YangHuiSanJiao {
public static int fac(int n){
if(n==0||n==1)
return n=1;
else
return n*fac(n-1);
} //递归法求阶乘
public static int yanghui(int a,int b){
return fac(a)/(fac(a-b)*fac(b));
} //计算杨辉三角没个数字的规律
public static void main(String[] args){
String line=""; //赋初值有必要,并不保证下面第28行赋值成功,
int hangshu;
while(1==1){
System.out.print("Please enter the lines:");
try{
BufferedReader in=new BufferedReader(new
InputStreamReader(System.in));
line=in.readLine();
}catch(IOException e){} //捕获异常代码
hangshu=Integer.parseInt(line);
if(hangshu>0) //与整个while语句体判断输入是否大于零
break;
}
for(int i=0;i<hangshu;i++){
for(int j=0;j<=i;j++)
System.out.print(yanghui(i,j)+" ");
System.out.println();
} //输出
}
}