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 2007551309 at 2009-02-13 23:18:00
#include<iostream>
using namespace std;
int main()
{
	int p,e,i,d,sum=0,t=1,j;
	cin>>p>>e>>i>>d;
	while(p!=-1||e!=-1||i!=-1||d!=-1)
	{
		for(j=1;sum<21252;j++)
		{
			sum=j*23+p;
			if((sum-e)%28==0&&(sum-i)%33==0)
			{
				cout<<"Case "<<t<<": the next triple peak occurs in "<<sum-d<< " days."<<endl;
				break;
			}
		}
	  t++;
	  sum=0;
	  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