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 tmkbmj at 2009-03-13 15:57:49 on Problem 1006
#include"stdio.h"
int main()
{
	int p,e,i;
	int d;
	int j=1;
	int n;
	
	while(scanf("%d %d %d %d",&p,&e,&i,&d)==4)
	{
		t=0;
		if(i==-1&&p==-1&&e==-1&&d==-1)
		return 0;
		n=0;
		if(p>23) p=p%23;
		if(e>28) e=e%28;
		if(i>33) i=i%33;
		while(n<21252) 
			{
				if((n%23==p)&&(n%28==e)&&(n%33==i))
				{
					if(n-d<=0)
						printf("Case %d: the next triple peak occurs in %d days.\n",j,n-d+21252);
					else
					printf("Case %d: the next triple peak occurs in %d days.\n",j,n-d);
				
					break;
				}
				else 
					n++;
			}
		
		
		j++;

	}
	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