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

Re:一个简单的代码

Posted by yuech at 2009-07-15 10:20:35 on Problem 2575
In Reply To:一个简单的代码 Posted by:fuliang at 2009-05-03 23:46:19
为什么我的就WA呢


#include<stdio.h>
#include<math.h>
#include<string.h>
int main()
{
    int n,i,j,h[3005],a[3005];
    while(scanf("%d",&n)!=EOF)
    {
      for(i=0;i<n;i++)
      scanf("%d",&a[i]);
      memset(h,0,3005);
      for(i=1;i<n;i++)
      {
          j=a[i]-a[i-1];
          if(j<0)
          j=-j;
          h[j]=1;
          }
      for(i=1;i<n;i++)
             if(h[i]==0)
            {
                 printf("Not jolly\n");
                 break;
                 }
      if(i==n)
              printf("Jolly\n");                 
      }
      
      return 0;
}

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