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 tide713 at 2004-11-02 22:27:47 on Problem 1006
In Reply To:各位老大帮忙看看吧! Posted by:joggi at 2004-05-27 15:56:47
>#include <stdio.h>
#include<iostream.h>
main()
{ int i,m,tc=1;
  int x,y,z,d;
  while(1)
  {  cin>>x>>y>>z>>d;
     if(x==-1||y==-1||z==-1||d==-1||x>365||y>365||z>365||d>365)
	    break;
	    i=0;
		while(1)
		{
		   m=33*i+z;
                   i++;
		   if((m-y)%28==0&&(m-x)%23==0)
			    break;
		}
		m=m-d;
		if(m==0)
			m=21252;
		if(m<0)
			m=21252+m;
   cout<<"Case "<<tc<<": the next triple peak occurs in "<<m<<" days."<<endl;
   tc++;
  }

}
//到底陷阱在那里,我找不到呀,咋的都是WA!

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