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 |
请高手帮忙看看,我对那些变态数据都测试过了,为什么还是WA?#include<iostream> using namespace std; int main(){ int p,e,i,d,num = 1,result; while(cin>>p>>e>>i>>d){ if(p == -1 & e == -1 & i == -1 & d == -1) break; else{ while(i >= 0& p>=0 & e>=0){ i-=33; p-=23; e-=28; } i+=33; p+=23; e+=28; while(1){ if( (i - p)%23 == 0 & (i - e)%28 == 0 ) { result = i-d; if(result > 0){ cout<<"Case "<<num<<": the next triple peak occurs in "<<result<<" days."<<endl;break;} } i+=33;} num++; }} return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator