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 |
为何 提交 就 不对呢~ 如此水题~哪位高手帮忙看看吧~ Problem: 3173 User: 810974380 Memory: N/A Time: N/A Language: C Result: Wrong Answer Source Code #include<stdio.h> #include<stdlib.h> int a[30]; int main() { int i,j,k,n,s; scanf("%d%d",&n,&s); for(i=1;i<=n;i++) { a[0]=s+i-1; for(j=1;j<n;j++) { a[j]=(a[j-1]+j); if(a[j]>9) a[j]=(a[j-1]+j)%9; } if(i>1) { for(k=0;k<i-1;k++) a[k]=0; } for(j=0;j<n;j++) { if(a[j]==0) putchar(' '); else printf("%d",a[j]); if(j<n-1) putchar(' '); } putchar('\n'); } system("pause"); return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator