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> #define MAX 10 void main() { int i,j,n; int a[MAX]; while(1) { scanf("%d",&n); for(i=0;i<n;i++) { { for(j=i;j>=0;j--) if(i!=j&&j!=0) a[j]=a[j-1]+a[j]; else a[j]=1; for(j=0;j<=i;j++) printf("%-4d",a[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