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 00108035 at 2004-05-18 13:38:22 on Problem 1006
测试了n组数据……提交还是WA

#include <iostream.h>
void main()
{
	int a,b,c,d,t=0;
	while(++t)
	{
		cin>>a>>b>>c>>d;
	    if(a>365||b>365||c>365||d>365||a<=-1||b<=-1||c<=-1||d<=-1) 
			return;
		for(int i=a; ;i+=23)
		{
			if(a==b&&a==c) 
			{
				if(a<=d) i=23*28*33+a;
				else break;
				break;
			}
			if((i-b)%28==0 && (i-c)%33==0) break;
		}
		cout<<"Case "<<t<<": the next triple peak occurs in "<<i-d<<" days."<<endl;
	}
}

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