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

1006 过了的兄弟帮忙看下吧 实在不知道为什么WA

Posted by East6 at 2007-09-04 16:50:20
#include <stdio.h>
#define MAXN 1000

void main(void)
{
	int p, e, i, d;
	int n[MAXN];
	int j, k;

	k = 1;
	while (1)
	{
		scanf("%d %d %d %d", &p, &e, &i, &d);
		if (p==-1 && e==-1 && i==-1 && d==-1)
			break;
		for (j = 0; j < 645; j++)
		{
			n[k] = 33 * j + i;
			if ((n[k] - p) % 23 != 0)
				continue;
			if ((n[k] - e) % 28 != 0)
				continue;
			if (n[k]==p || n[k]==e || n[k]==i || n[k]==d)
				continue;
			break;
		}
		n[k] -= d;
		k++;
	}
	for (j = 1; j < k; j++)
		printf("Case %d: the next triple peak occurs in %d days.\n", j, n[j]);
}

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