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

how do u konw your answer is correct?

Posted by TN at 2005-04-24 16:40:51 on Problem 1006
In Reply To:答案是正确的啊,怎么老是WRONG ANSWER Posted by:yangjie at 2005-04-24 16:02:07
> #include <iostream.h>
> #include <math.h>
> double slum(int p,int e,int i,int d)
> {
> 	for (int n=0;;n++)
> 	{
> 	if(((n+p)%23==0)&&((n+e)%28==0)&&((n+i)%33==0))
> 	{
> 	return	(21252-n-d);
> 	   break;
> 	}
> 	}
> }	
> void main()
> {
> 	int p,e,i,d;
> 	cin>>p>>e>>i>>d;
> 	for(int j=0;e!=-1||p!=-1||i!=-1||d!=-1;j++)
> 	{
> 		 cout<<"Case"<<' '<<j+1<<":"<<' '<<"the next triple occurs in"<<' '<<slum(p,e,i,d)<<' '<<"days."<<endl;
>          cin>>p>>e>>i>>d;
> 		 continue;
> 	}
> 
> }
> 
> 
> 

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