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

why wrong answers? HELP HELP HELP

Posted by xbh at 2006-04-17 23:49:41 on Problem 1006
#include<iostream.h>
int main()
{
	int m=0;
	long p,e,i,d,s;
	while(cin>>p>>e>>i>>d,p!=-1&&e!=-1&&i!=-1&&d!=-1)
	{
		m++;
		p=p%23;e=e%28;i=i%33;
		for(s=1;s<=21252-d;s++)
		{
			if((d+s)%23==p&&(d+s)%28==e&&(d+s)%33==i)
				cout<<"Case "<<m<<":"<<" the next triple peak occurs in "<<s<<" 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