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 xulaichun at 2005-10-26 20:24:24 on Problem 1006
In Reply To:请大家帮忙看看,为什么错了啊,我很菜 Posted by:xulaichun at 2005-10-26 20:23:28
> #include<iostream.h>
> int main()
> {
> 	int p,e,i,d;
> 	p = e = i = d = 1;
> 	int time = 0;//i is used to count
> 	cin>>p>>e>>i>>d;
> 	while(p != -1 && p<=365 || e != -1 && e<=365 || i != -1 && i<=365 || d != -1 && d<= 365)
> 	{
> 		for(int j = 1;j<=21252;j++)
> 		{
> 			if((j-p)%23 == 0 && (j-e)%28 == 0 && (j-i)%33 == 0)
> 				break;
> 		}
> 		cout<<"Case "<<(time+1)<<": the next triple peak occurs in "<<(j-d)<<" days."<<endl;
> 		time++;
> 		cin>>p>>e>>i>>d;
> 	}
> 	return 1;
> }

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