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 |
水之!!!!附代码!!#include<stdio.h> int main() { int n,m,j,k,l; while(~scanf("%d%d",&n,&m)) { int d[44][44]; d[0][0]=m; printf("%d",m); int i; for(i=1;i<n;i++) { d[0][i]=(d[0][i-1]+i)%9; if(d[0][i]==0) d[0][i]=9; printf(" %d",d[0][i]); } printf("\n"); for(i=1;i<n;i++) { printf(" "); for(j=0;j<i-1;j++) { printf(" "); } for(j=i;j<n;j++) { d[i][j]=(d[i-1][j]+1)%9; if(d[i][j]==0) d[i][j]=9; printf(" %d",d[i][j]); } printf("\n"); } } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator