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 tanchimaoyx at 2010-12-10 14:47:29 on Problem 1006
#include "stdafx.h"
#include<iostream>
using namespace std;


int main()
{
	int num=0;
	int i=0;
	int m,n,o,p;
   while(cin>>m>>n>>o>>p)
   {
	 if(m==-1&&n==-1&&o==-1&&p==-1)
        return 0;
     else{
		  m=m%23;
		  n=n%28;
		  o=o%33;
	      int value=o+33;
	      while(value<65535)
	           {
                 if((value-m)%23==0&&(value-n)%28==0&&value>p)
		            {num=value;
		              i++;
		             break;

		             }
		         value=value+33;
	           }
		  
     cout<<"Case "<<i<<": the next triple peak occurs in "<<num-p<<" days."<<endl;
        }
      
   }
   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