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

C++做的 达人帮看下

Posted by zhcmeng at 2006-07-30 09:58:45 on Problem 1006
#include<iostream>
using namespace std;
int main(){
	static int t=1;
	int p,e,i,d;
	while(cin>>p>>e>>i>>d)
	{
		if(p==-1&&e==-1&&i==-1&&d==-1)
			goto poco;
		if(p>=0&&p<=365&&e>=0&&e<=365&&i>=0&&i<=365&&d>=0&&d<=365)
		{    
		    for(int k=1;k<=21252;k++)
			{
			    if((k+p)%23==0&&(k+e)%28==0&&(k+i)%33==0)
				{
				    cout<<"Case "<<t<<": the next triple peak occurs in ";
				    if(21252-k-d>0)
					{
					    cout<<21252-k-d<<" days."<<endl;
					    t++;
					    break;
					}
				    if(21252-k-d<=0)
					{
					    cout<<k-d<<" days."<<endl;
					    t++;
					    break;
					}

				}
			}
		}
	}
poco:
	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