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:对不起 ,刚才那个程序发错了,请以这个为准,为什么是run time error???

Posted by dfitf at 2004-05-21 09:50:04 on Problem 1006
In Reply To:Re:为何总是run time error 我觉得循环次数不是很多阿 Posted by:dfitf at 2004-05-21 09:47:49
#include <iostream.h>
void main()
{
	static int a[100],b[100],c[100],d[100],e[100];
	int i=0;

	while (a[i]!=-1)
	{
			 int t=1;
		i++;
		cin>>a[i]>>b[i]>>c[i]>>d[i];
	  
	   while (t<=644)
	   {
		   if ((c[i]+33*t-a[i])%23==0&&(c[i]+33*t-b[i])%28==0)
			   break;
		   else t++;
	   }
	  
	   e[i]=c[i]+33*t-d[i];
	  
	}
	for (int j=1;j<i;j++)
		cout<<"Case "<<j<<": the next triple peak occurs in "<<e[j]<<" days."<<endl;
}




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