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

Why wrong

Posted by wangfengtian at 2008-12-05 15:41:04 on Problem 2575
那位高手能指点我那里错了 我快疯了
那位高手能指点我那里错了 我快疯了
#include<stdio.h>
#include<math.h>
void main()
{
	int n,a[10000],k,i;

	while(scanf("%d",&n)!=EOF)
	{
		
		for(i=0;i<n;i++)
			scanf("%d",&a[i]);
			k=0;
		
	
		for(i=0;i<n-1;i++)
		{
			if(n==1)
			{
				printf("Jolly\n");
				k=1;
				break;
			}
			if(abs(a[i]-a[i+1])>n-1||abs(a[i]-a[i+1])<1)
			{
			printf("Not jolly\n");
			k=1;
				break;
			}
		}
		if(k==0)
			printf("Jolly\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