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

谁知道为什么我这个是WA(1006)

Posted by fjq0555 at 2006-08-15 01:56:59
#include <stdio.h>
int main()
{
  long int num,p,e,i,d;
  num=0;
  while(scanf("%ld %ld %ld %ld",&p,&e,&i,&d)!=EOF)
  {
	  if(p==-1&&e==-1&&i==-1&&d==-1)
		  break;
	  num++;
	  while(1)
	  {
		  i+=33;
		  if((i-e)%28==0&&(i-p)%23==0)
		  {
			  if(i!=d)
			  {
				printf("Case %ld: the next triple peak occurs in %ld days.\n",num,i-d);
				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