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 |
你还是再自己查自己的错吧In Reply To:spj没问题吧,为什么WA阿 Posted by:PC0400322032 at 2004-07-26 21:33:09 给你看了一下,第一组数据就错了,肉眼就能看出来 > #include <stdio.h> > void main(void) > { > int n; > int i,j,k; > scanf("%d",&n); > k=2*n+1; > for(i=0;i<n;i++) > { > printf("%d ",k++); > for(j=0;j<i+1;j++) > printf("%d ",n*(n-i+j)-j); > printf("\n"); > } > for(i=n-1;i>2;i--) > { > printf("%d",k++); > for(j=0;j<i;j++) > printf(" %d",n*j + i - j); > printf("\n"); > } > printf("%d 2\n",k++); > printf("%d 1\n",k); > } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator