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 fantasyorg at 2007-06-22 08:55:32 on Problem 1006
#include<iostream>
using namespace std;

int main()
{
	int a, b, c, d, times, t = 0;

	while (1)
	{
		cin >> a >> b >> c >> d;
		if (a == -1)
			break;
		t ++;
		
		for (int i = 1; ; i ++)
			if ((i + d - a) % 23 == 0 && (i + d - b) % 28 == 0 && (i + d - c) % 33 == 0)
			{
				cout << "Case " << t << ": the next triple peak occurs in " << i << " days" << endl;
				break;
			}
	}
}


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