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

服了。。就是wa。。大牛看看。。

Posted by zhangkeabcd at 2010-08-02 16:06:27 on Problem 1006
#include<iostream>
#include<math.h>
using namespace std;
int main()
{
	int a,b,c,d,i,j=1;
	while(scanf("%d%d%d%d",&a,&b,&c,&d)&&(a!=-1&&b!=-1&&c!=-1))
	{
		for(i=d+1;i<=21252;i++)
		{
			if(abs(i-a+d)%23==0&&abs(i-b+d)%28==0&&abs(i-c+d)%33==0)
				cout<<"Case "<<j++<<": the next triple peak occurs in "<<i<<" days."<<endl;
		}
	}
	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