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 lbp at 2005-03-24 16:34:29 on Problem 1006
#include<iostream.h>
#include<stdlib.h>
void main()
{
	int in[4],j,count=0;
	do{
		j=0;
		for(long int i=0;i<4;i++)
		{
			cin>>in[i];
			if(in[i]==-1)
				j++;
		}
		if(j==4)exit(0);
		count++;
		 long int res,temp1,temp2,temp3,temp4;
		for(i=1;;i++)
		{
			temp1=(10*i+in[2]-in[0])%23;
			temp2=(5*i+in[2]-in[1])%28;
			temp3=i+(10*i+in[2]-in[0])/23;
			temp4=i+(5*i+in[2]-in[1])/28;
			res=i*33+in[2]-in[3];
			if(temp1==0&&temp2==0&&res>0&&temp3>0&&temp4>0)
			{
				  
				 break;
			}
		}
		cout<<"Case "<<count<<": the next triple peak occurs in "
			<<res<<" days."<<endl;

	}while(1==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