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

高手帮一下 测试数据都对 就是提交时候错误。

Posted by chenjin at 2006-09-08 12:46:43 on Problem 1006
#include"iostream.h"
int k;
void f(int p,int e,int i,int d)
{ 
	


	for(int j=d+1;j<21252;j++)
	
	{if(float(j-p)/23==(j-p)/23&&float(j-e)/28==(j-e)/28&&float(j-i)/33==(j-i)/33)
			break;}
	
			cout<<"Case "<<k<<": "<<"the next triple peak occurs in "<<j-d<<" days."<<endl;

	
}
void main()
{
	int p,e,i,d;
	
	
	for(k=1;;k++)
	{

		cin>>p>>e>>i>>d;
		if(p==-1||e==-1||i==-1||d==-1)
		break;
		f(p,e,i,d);
	
		
	}
}


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