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:47:49 on Problem 1006
In Reply To:为何总是run time error 我觉得循环次数不是很多阿 Posted by:dfitf at 2004-05-21 09:37:22
> #include <iostream.h>
> void main()
> {
> 	static int a[100],b[100],c[100],d[100];
> 	int i=0;
> 	 int t=1;
> 	while (a[i]!=-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++;
> 	   }
> 	  
> 	   
> 	  
> 	}
> 	for (int j=1;j<i;j++)
> 		cout<<"Case "<<j<<": the next triple peak occurs in "<<c[j]+33*t-a[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