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

各位高手指点一下,这为什么不能过,2 2 2 2 的数据不出结果,出结果的数据结果都对,问一下,是不是时间的问题,是因为用时太长,不出结果吗?急求解释。

Posted by mengsongshi at 2010-07-12 15:33:26 on Problem 1006
# include<stdio.h>
int main()
{
int p,e,i,d,s,count=1,k;
while(scanf("%d%d%d%d",&p,&e,&i,&d)&&p!=-1||e!=-1||i!=-1||d!=-1)
{
for(k=d+1;k<=21252;k++)
{
if((k-p)%23!=0)
continue;
else{
if((k-e)%28!=0)
continue;
else{
if((k-i)%33!=0)
continue;
}
}
printf("Case %d: the next triple peak occurs in %d days.\n",count,k-d);
count++;
} 
}
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