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 |
Re:测试很多遍都没有错误,为什么是wrong answerIn Reply To:测试很多遍都没有错误,为什么是wrong answer Posted by:ZhaoChaoyi at 2016-10-04 17:16:59 > #include<stdio.h> > int main() > { > int p,e,i,d; > int x,k; > while(~scanf("%d%d%d%d",&p,&e,&i,&d)) > { > if(p==-1&&e==-1&&i==-1&&d==-1) > break; > x=d; > k=1; > while(x<=d+21252) > { > if((x-p)%23==0&&(x-e)%28==0&&(x-i)%33==0) > break; > x++; > k++; > } > if(x==d) > printf("Case %d: the next triple peak occurs in 21252 days.\n",k); > else > printf("Case %d: the next triple peak occurs in %d days.\n",k,x-d); > > } > return 0; > } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator