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 zyp at 2005-08-28 20:54:00 on Problem 1006
#include <iostream>
using namespace std;
int main()
{int a,b,c,d, i,j=1;
 cin>>a>>b>>c>>d;
  while(!(a==-1&&b==-1&&c==-1&&d==-1))
  {
  for(i=c; ;i+=33)
	  if((i-a)%23==0&&(i-b)%28==0&&(i-c)%33==0)
		  break;
     ;
          if(i<=d)
		   for(i=d+1;;i++)
			 if((i-a)%23==0&&(i-b)%28==0&&(i-c)%33==0)
		  break; 
  cout<<"Case "<<j<<": the next triple peak occurs in "<<i-d<<" days."<<endl;
  cin>>a>>b>>c>>d;
  j++;
  }
  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