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> #include<string.h> int main() { int i,j,n,s; int a[100]; while(scanf("%d%d",&n,&s)!=EOF) { memset(a,0,sizeof(a)); for(i=0;i<n;i++) { s=s+i; if(s>9) s=s-9; a[i]=s; //printf("**%d",a[i]); } int g=0; for(i=0;i<n;i++) { for(j=1;j<=2*i;j++) printf(" "); for(j=g;j<n-1;j++) printf("%d ",a[j]); printf("%d",a[n-1]); if(g!=n-1) printf("\n"); g++; for(j=g;j<n;j++) { a[j]=a[j]+1; if(a[j]>9) a[j]=a[j]-9; } } } } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator