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)我测过数据都正确的,提交都是WA,麻烦高手看下! #include<iostream> using namespace std; int main() { int p,e,i,d,j,k=1; cin>>p>>e>>i>>d; while(!(p==-1&&e==-1&&i==-1&&d==-1)) { p%=23; e%=28; i%=33; for(j=1;;j++) if((23*j+p-e)%28==0&&(23*j+p-i)%33==0) break; cout<<"Case "<<k++<<": the next triple peak occurs in " <<23*j+p-d<<" days."<<endl; cin>>p>>e>>i>>d; } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator