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 c0500448242 at 2005-07-22 10:01:44 on Problem 1006
In Reply To:各位大侠,江湖救急,为什么sample对了,但是是wa呢? Posted by:nan at 2005-07-22 09:40:10
#include "Stdio.h"

int main()
{
  int p,e,i,d,k=0,day;
  do
  {
    scanf("%d%d%d%d",&p,&e,&i,&d);
    k++;
    if (p!=-1 && e!=-1 && i!=-1 && d!=-1)
	{
		p=p%23;e=e%28;i=i%33;
		for(day=1;day<=21252;day++)
		{
			if ((day+d)%23==p && (day+d)%28==e && (day+d)%33==i)
			{
				printf("Case %d: the next triple peak occurs in %d days.\n",k,day);
				break;
			}
		}  
	}

  }
  while (p!=-1 && e!=-1 && i!=-1 && d!=-1);
  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