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

Why WA ??

Posted by isAir at 2006-08-19 00:37:26 on Problem 1006
#include <stdio.h>
#define P 23
#define E 28
#define I 33

void main()
{
	int ca=1;
	int p,e,i,d;

	while(1){
		p%=P;
		p+=P;
		scanf("%d %d %d %d",&p,&e,&i,&d);
		if(p==-1) break;

		while(p <=d ||  (p-e)%E || (p-i)%I ) p+=P;
		printf("Case %d: the next triple peak occurs in %d days.\n",ca++,p-d);
	}
}

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