Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

在SGU上AC了,但这里不能,大家能帮我看看吗?谢谢了!

Posted by WZPWZPWZP at 2005-08-20 14:52:18 on Problem 1710
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator