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 1193532792 at 2012-03-21 19:12:12 on Problem 1006
#include<stdio.h>
int main()
{
	int x,p,e,i,d,n=0;
	float a,b,c;
    while(scanf("%d%d%d%d",&p,&e,&i,&d)&&p!=-1&&e!=-1&&i!=-1&&d!=-1)
	{
		for(x=21252;x>=0;x--)
		{
          a=(x+(d-p))%23;
		  if (a!=0) continue;
          else
		  {
			  b=(x+(d-e))%28;
			  if(b!=0) continue;
			  else 
			  {
				  c=(x+(d-i))%33;
				  if(c!=0) continue;
				  else 
				  {
			         n++;
			         printf("Case %d: the next triple peak occurs in %d days.\n",n,x);
			        break;
				  }
			  }
		  }
		  
		}
	}
	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