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> #include<math.h> using namespace std; int main() { int p,e,i,d; while(cin>>p>>e>>i>>d) { if(p==-1&&e==-1&&i==-1&&d==-1) { break; } if(d<0||d>=365) { break; } int m; for(m=d;m<=21252;m++) { if(p==0&&e==0&&i==0&&d==0) { cout<<"the next triple peak occurs in "<<21252<<" days."<<endl; break; } if((m+d-p)%23==0&&(m+d-e)%28==0&&(m+d-i)%33==0) { cout<<"the next triple peak occurs in "<<m<<" days."<<endl; break; } } } return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator