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

我的怎么还是不行啊?

Posted by yelin at 2009-03-12 15:46:06 on Problem 1006
In Reply To:通过了,一点经验 Posted by:saintguang at 2008-04-08 14:04:23
#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&&(j-d)<=21252)
                {
                    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