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 AB38017032 at 2012-02-27 20:00:39 on Problem 1006
#include <stdio.h>
int main()
{
int p,e,i,d,x,number,s=0;
while(scanf("%d%d%d%d",&p,&e,&i,&d)==4)
{
if(p==-1 && e==-1 && i==-1 && d==-1)break;
for(x=1;;x++)
{
if(x>d)
if((p-x)%23==0 && (e-x)%28==0 && (i-x)%33==0)
{
number=x-d;break;
}
else
{
if((x-p)%23==0 && (x-e)%28==0 && (x-i)%33==0)
if(x-d>21252) 
{number=21252;break;}
else 
{number=x-d;break;}
}
}
printf("case %d:the next triple peak occurs in %d days.\n",++s,number);
}
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