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

怎么测试数据都过了,下面的特殊数据也过了,但就是说wrong answer呢?

Posted by yelin at 2009-03-11 19:50:53 on Problem 1006
#include<stdio.h>
int main()
{
    int p,e,i,d,c,j;
    for(c=0;;c++)
    {
        scanf("%d %d %d %d",&p,&e,&i,&d);
        if(d==-1)
        break;
        for(j=d;;j++)
        {
            if((j-p)%23==0&&(j-e)%28==0&&(j-i)%33==0&&(j-p)!=0&&(j-e)!=0&&(j-i)!=0)
            {
                if((j-d)!=0)
                {
                    printf("Case %d: the next triple peak occurs in %d days.\n",c+1,j-d);
                    break;
                }
                else
                {
                    printf("Case %d: the next triple peak occurs in 21252 days.\n",c+1);
                    break;
                }
            }
        }
    }
    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