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

高手&好心人,帮帮我呀 呀 呀呀!!为什么Wrong Anwser?

Posted by winter_1 at 2006-04-25 19:46:35 on Problem 1006
#include<stdio.h>
#include<math.h>
void main()
{
	int p,e,i,d;
	int k=0;
	scanf("%d %d %d %d",&p,&e,&i,&d);
	while(!(p==-1&&e==-1&&i==-1&&d==-1)){
		p=p%23;
		int j=0;
		while(p+j*23<=21252){
			if((p+j*23-e)%28==0&&(p+j*23-i)%33==0&&(p+j*23)>d){
				k++;
				printf("Case %d: the next triple peak occurs in %d days.\n",k,p+j*23-d);
				break;
			}
			j++;
		}
        scanf("%d %d %d %d",&p,&e,&i,&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