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 1234554321 at 2005-03-18 08:30:52 on Problem 1006
#include<iostream.h>
#include<math.h>

int main ()
{
	int p,e,i,d,days,t=0;

	while(1)
	{

		cin>>p>>e>>i>>d;
		if(p==-1) break;
		for(int j=0;;j++)
		{
			if((23*j+p-e)>0&&(23*j+p-e)%28==0&&(23*j+p-i)%33==0)
			break;
		}

		days=23*j+p-d;
		cout<<"Case "<<t+1<<": the next triple peak occurs in "<<days<<" days."<<endl;
		t++;
	}
	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