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 568082880 at 2015-05-11 08:00:26 on Problem 1006
In Reply To:Re:求助大神看看我这代码哪里错了 我试了好多数都可以啊 Posted by:littlehu at 2015-05-01 17:16:25
> #include<iostream>
> #include<math.h>
> #include<vector>
> using namespace std;
> int main()
> {
> 	int p,e,i,d;
> 	int time=1;
> 	while(cin>>p>>e>>i>>d)
> 	{
> 		if(p==-1&&e==-1&&i==-1&&d==-1)
> 		{
> 			break;
> 		}
> 		if(d<0||d>=365)
> 		{
> 			break;
> 		}
> 		int m;
> 		
> 		for(m=d;m<=21252;m++)
> 		{
> 			if(p==0&&e==0&&i==0&&d==0)
> 			{
> 				cout<<"case "<<time<<": the next triple peak occurs in "<<21252<<“ days."<<endl;
> 				time++;
> 				break;
> 			}
> 			if((m+d-p)%23==0&&(m+d-e)%28==0&&(m+d-i)%33==0)
> 			{
> 				cout<<"case "<<time<<": the next triple peak occurs in "<<m<<" days."<<endl;
> 				time++;
> 				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