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:给你改了一下In Reply To:给你改了一下 Posted by:c0500448242 at 2005-07-22 10:01:44 > #include "Stdio.h" > > int main() > { > int p,e,i,d,k=0,day; > do > { > scanf("%d%d%d%d",&p,&e,&i,&d); > k++; > if (p!=-1 && e!=-1 && i!=-1 && d!=-1) > { > p=p%23;e=e%28;i=i%33; > for(day=1;day<=21252;day++) > { > if ((day+d)%23==p && (day+d)%28==e && (day+d)%33==i) > { > printf("Case %d: the next triple peak occurs in %d days.\n",k,day); > break; > } > } > } > > } > while (p!=-1 && e!=-1 && i!=-1 && d!=-1); > return 0; > } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator