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 |
Also wrong Anwser#include<stdio.h> #include<math.h> void main() { int p,e,i,d; int k=0; scanf("%d %d %d %d",&p,&e,&i,&d); while(!(p==-1&&e==-1&&i==-1&&d==-1)){ p=p%23; int j=0; while(p+j*23<=21252){ if((p+j*23-e)%28==0&&(p+j*23-i)%33==0&&(p+j*23)>=d){ if(d==0&&(p+j*23)==0){ goto k; } else{ k++; printf("Case %d: the next triple peak occurs in %d days.\n",k,p+j*23-d); break; } } k: j++; } scanf("%d %d %d %d",&p,&e,&i,&d); } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator