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

求助,1006,明明数据都测试过了,就是过不去

Posted by Icewave at 2011-03-11 19:37:17 on Problem 1006
#include<iostream>
using namespace std;
int main(){
    int p , e , i , d;
	bool tre = 0;
	int count = 0;
	while((cin >> p >> e >> i >> d)&&!(p==-1 && e==-1 && i==-1 && d==-1) ){
		tre = 0;
		++count;
		for( ; i <= 21252 ; ){
			for( ; e <= i ; ){
				for( ; p <= e ; ){
					if(p == e && e == i && p > d){
						tre = 1;
					    cout <<"Case " << count <<": the next triple peak occurs in " << p - d <<" days." << endl;
						break;
					}
					p += 23;
				}
				if(tre == 1)
					break;
				e += 28;
			}
			if(tre == 1)
				break;
			i += 33;
		}
	}
	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