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 |
谁能看看程序哪里有问题觉得没错的说……大虾们指教一下……谢谢!!! #include<iostream> using namespace std; int main() { int p,e,i,d,n=0,s=0; for(;;){ cin>>p>>e>>i>>d; if(p==-1&&e==-1&&i==-1&&d==-1)break; n++; if(p==e&&e==i&&i==d)s=p+21252; else{ while(p!=e){ if(p<e)p+=23; else e+=28; } while(p!=i){ if(p<i)p+=644; else i+=33; } s=i%21252; if(s<d)s+=21252; } cout<<"Case "<<n<<": the next triple peak occurs in " <<(s-d)<<" days."<<endl; } return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator