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 hsmwzj at 2010-08-04 10:49:27 on Problem 1006
#include <iostream>
using namespace std;

int main()
{
	int p,e,i,d;
	cin>>p>>e>>i>>d;
	int temp;
	if (p==-1||e==-1||i==-1||d==-1)
		return 0;
	int count=1;
	int days;
	p = p%23;
	e = e%28;
	i = i%33;
	temp = i+33;
	while (1)
	{
		if (temp%23==p&&temp%28==e)
		{
			days = temp-d;
			if (days>21252)
				days -= 21252; 
			cout<<"Case "<<count++<<": the next triple peak occurs in "<<days<<" days."<<endl;
			cin>>p>>e>>i>>d;
			if (p==-1||e==-1||i==-1||d==-1)
				return 0;
			p = p%23;
			e = e%28;
			i = i%33;
			temp = i+33;
		}
		else	temp = temp +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