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 littlehu at 2015-05-01 16:53:47 on Problem 1006
#include<iostream>
#include<math.h>
using namespace std;
int main()
{
	int p,e,i,d;
	while(cin>>p>>e>>i>>d)
	{
		if(p==-1&&e==-1&&i==-1&&d==-1)
		{
			break;
		}
		if(d<0||d>=365)
		{
			break;
		}
		int m;
		
		for(m=d;m<=21252;m++)
		{
			if(p==0&&e==0&&i==0&&d==0)
			{
				cout<<"the next triple peak occurs in "<<21252<<" days."<<endl;
				break;
			}
			if((m+d-p)%23==0&&(m+d-e)%28==0&&(m+d-i)%33==0)
			{
				cout<<"the next triple peak occurs in "<<m<<" days."<<endl;
				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