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

大家看看怎么错了 帮帮忙 新手

Posted by 072988 at 2009-01-09 19:02:42 on Problem 1006
#include <stdio.h>
int main()
{
  int p,e,i,d,j,term=1,m;
  while(term>0)
  {
	scanf("%d%d%d%d",&p,&e,&i,&d);
    if(p==-1 && e==-1 && i==-1 && d==-1)
		break;
	for(j=1;;j++)
		if((j-p)%23==0 && (j-e)%28==0 && (j-i)%33==0)
			break;
		m=j;
	m=m-d;
      m=m%21252;
	if(m==0)
		m=21252;
    printf("Case %d: the next triple peak occurs in %d days.\n",term,m);
  }
  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