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

求助(WA)

Posted by yyy450 at 2008-01-27 13:31:46 on Problem 1006
我测过数据都正确的,提交都是WA,麻烦高手看下!
#include<iostream>
using namespace std;

int main()
{
    int p,e,i,d,j,k=1;
    cin>>p>>e>>i>>d;
    while(!(p==-1&&e==-1&&i==-1&&d==-1))
    {
         p%=23;
         e%=28;
         i%=33;
         for(j=1;;j++)
         if((23*j+p-e)%28==0&&(23*j+p-i)%33==0)
         break;
         cout<<"Case "<<k++<<": the next triple peak occurs in "
         <<23*j+p-d<<" days."<<endl;
         cin>>p>>e>>i>>d;
    }

    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