Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
各位高手指点一下,这为什么不能过,2 2 2 2 的数据不出结果,出结果的数据结果都对,问一下,是不是时间的问题,是因为用时太长,不出结果吗?急求解释。# 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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator