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 miaojinquan at 2008-08-02 11:23:31 on Problem 1006
#include <iostream>
using namespace std;
int main()
{
	int p,e,i,d,t;
	int m;
	int num=0;
	while(1)
	{
		num++;
		t=-1;
 		scanf("%d%d%d%d",&p,&e,&i,&d);
 		if(p==-1 && e==-1 && i==-1 && d==-1)
 			break;
		while(1)
		{
			t++;
			m=(d+t)%365;
			if((d+t-p)%23==0&&(d+t-e)%28==0&&(d+t-i)%33==0)
			{
				if(d==m)
					continue;
				else 
					printf("Case %d: the next triple peak occurs in %d days.\n",num,t);
				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