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 |
在SGU上AC了,但这里不能,大家能帮我看看吗?谢谢了!#include <stdio.h> int main() { int n,i,j; scanf("%d",&n); printf("%d ",2*n); for( i = 1 ; i <= n ; i++ ) for( j = 1 ; j <= n ; j++ ) if( (i+j)%2==1 ) printf("%d ",n*(i-1)+j); printf("\n"); printf("%d ",2*n+1); for( i = 1 ; i <= n ; i++ ) for( j = 1 ; j <= n ; j++ ) if( (i+j)%2==0 && (i!=1||j!=1) ) printf("%d ",n*(i-1)+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