#include "iostream.h"
#include "iomanip.h"
main()
{
int i,j,a[10][10]={0},n;
cout<<"请输入一个整数,来确定显示的行数:";
cin>>n;
for(i=0;i<=n;i++)
{
a[i][0]=1;
a[i][i]=1;
}
for(i=1;i<=n-1;i++)
for(j=1;j<=i-1;j++)
a[i][j]=a[i-1][j-1]+a[i-1][j];
for(i=0;i<=n-1;i++)
{ for(j=1;j<=n-i;j++)
cout<<" ";
for(j=0;j<=i;j++)
cout<<setw(4)<<a[i][j];
cout<<endl;
}
}