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...谁帮我看看??谢谢.....

Posted by yellowflying at 2006-07-21 10:33:18 on Problem 1006
#include <stdio.h>
int main()
{
	long p,e,i,d,count=0,day,t;
	scanf("%d%d%d%d",&p,&e,&i,&d);
	while(p!=-1&&e!=-1&&i!=-1&&d!=-1)
	{
		count++;
		while(1)
		{
			if(p<=e&&p<=i)
				p=p+23;
			else if(e<=p&&e<=i)
				e=e+28;
			else
				i=i+33;
			if(p==e&&p==i)
				break;
		}
		t=(p-d-1)/21252;
		day=p-d-t*21252;
		printf("Case %d: the next triple peak occurs in %d days.\n",count,day);
		scanf("%d%d%d%d",&p,&e,&i,&d);
	}
	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