| ||||||||||
| 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:Trojan at 2006-05-26 21:07:16 > #include<iostream.h>
> int main()
> {
> int p,e,i,d,n,N,ca=0;
> cin>>p>>e>>i>>d;
> while(p!=-1||e!=-1||i!=-1||d!=-1)
> {
> ca++;
> n=0;
> while((n++)<=644)
> {
> N=33*n-(d-i);
> if((N+(d-e))%28==0&&(N+(d-p))%23==0)break;
> }
> if(N>21252)N-=21252;
> cout<<"Case "<<ca<<": the next triple peak occurs in "<<N<<" days."<<endl;
> cin>>p>>e>>i>>d;
> }
> return 0;
> }
不用了,我ac了
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator