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 |
how do u konw your answer is correct?In Reply To:答案是正确的啊,怎么老是WRONG ANSWER Posted by:yangjie at 2005-04-24 16:02:07 > #include <iostream.h> > #include <math.h> > double slum(int p,int e,int i,int d) > { > for (int n=0;;n++) > { > if(((n+p)%23==0)&&((n+e)%28==0)&&((n+i)%33==0)) > { > return (21252-n-d); > break; > } > } > } > void main() > { > int p,e,i,d; > cin>>p>>e>>i>>d; > for(int j=0;e!=-1||p!=-1||i!=-1||d!=-1;j++) > { > cout<<"Case"<<' '<<j+1<<":"<<' '<<"the next triple occurs in"<<' '<<slum(p,e,i,d)<<' '<<"days."<<endl; > cin>>p>>e>>i>>d; > continue; > } > > } > > > Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator