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

【NH求教高手】1006

Posted by apmvista at 2009-08-14 21:15:46
#include "stdio.h"
int main()
{
	long int p,e,i,d;
	int j;
	int n=0;
	long int temp;
	while (scanf("%d%d%d%d",&p,&e,&i,&d))
	{
		n++;
		if (p==-1 && e==-1 && i==-1 && d==-1)break;
		for (j=0;;j++)
		{
			i=i+33;
			if ((i-e)%28==0 && 
				(i-p)%23==0 && i!=0)
			{
				temp=i-d;
				printf("Case %d: the next triple peak occurs in %d days\n",n,temp);
				break;
			}
			continue;
		}
	}
	return 0;
}

WA了……不知道错哪里了,高手帮忙啊~~~

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