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,请高手帮忙看看,谢谢!!!#include <iostream> using namespace std; int main() { int p,e,i,d; int peakday[100]; int cnt=0; int n; cin>>p>>e>>i>>d; n=i; while (!(p==-1 &&e==-1 &&i==-1 && d==-1)) { n+=33; if ((n-e)%28==0 && (n-p)%23==0) { peakday[cnt++]=n-d; cin>>p>>e>>i>>d; n=i; } } for (i=0; i<cnt; i++) { cout<<"Case "<<i+1<<": the next triple peak occurs in "<<(peakday[i]%21252==0?21252:(peakday[i]%21252))<<" 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