| ||||||||||
| 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>
#include<math.h>
#include<iomanip>
using namespace std;
int main()
{int p,e,i,d,m,n=0;
while(cin>>p>>e>>i>>d)
{n++;
if((p!=-1)&&(e!=-1)&&(i!=-1)&&(d!=-1))
{
for(m=21252;m>0;m--)
{if(((m-p)%23==0)&&((m-e)%28==0)&&((m-i)%33==0))
{ if(m-d<=0)
cout<<"Case "<<n<<": the next triple peak occurs in "<<m-d+21252<<" days."
<<endl;
else
cout<<"Case "<<n<<": the next triple peak occurs in "<<m-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