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

帮帮忙啊1006 我的答案与给的一模一样 可还是WA

Posted by xueshanhaizi at 2007-08-05 16:25:34
#include <iostream>
# define N 500
using namespace std;
int main()
{
	int p,e,i,d,n=1,x=21252,j;
    for(int t=0;t<N;++t){
           cin>>p>>e>>i>>d;
	       if((p!=-1)&&(e!=-1)&&(i!=-1)&&(d!=-1)){
		for( j=d+1;j<=x;++j){
			 if(((j-p)%23==0)&&((j-e)%28==0)&&((j-i)%33==0)){
				
				cout<<"Case "<<n <<": the next triple peak occurs in "<< j-d<< " days."<<endl;
			    break;
					}
		}
		
	}
    else break;
    n++;
	
	}
system("pause");
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