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

Re:望高手指点

Posted by Trojan at 2006-05-26 21:26:37 on Problem 1006
In Reply To:望高手指点 Posted by:Trojan at 2006-05-26 21:07:16
> #include<iostream.h>
> int main()
> {
> 	int p,e,i,d,n,N,ca=0;
> 	cin>>p>>e>>i>>d;
> 	while(p!=-1||e!=-1||i!=-1||d!=-1)
> 	{
> 		ca++;
> 		n=0;
> 		while((n++)<=644)
> 		{	
> 			N=33*n-(d-i);
> 			if((N+(d-e))%28==0&&(N+(d-p))%23==0)break;
> 		}
> 		if(N>21252)N-=21252;
> 		cout<<"Case "<<ca<<": the next triple peak occurs in "<<N<<" days."<<endl;
> 		cin>>p>>e>>i>>d;
> 	}
> 	return 0;
> }
不用了,我ac了

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