Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
123456#include <stdio.h> #include <math.h> void main(){ int a[11][11],i,j,n; scanf("%d",&n); a[1][1]=1; for(j=0;j<n;j++){ a[j][0]=0; for(i=j+1;i<11;i++)a[j][i]=0; } for(j=2;j<=n;j++) for(i=1;i<j+1;i++) a[j][i]=a[j-1][i-1]+a[j-1][i]; for(j=1;j<=n;j++){ for(i=1;i<=j;i++)printf("%d ",a[j][i]); printf("\n"); } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator