| ||||||||||
| 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 p,e,i,d,t,j;
int main()
{
t=0;
while (cin>>p>>e>>i>>d,p!=-1||e!=-1||i!=-1||d!=-1)
{
t++;
p%=23;
e%=28;
i%=33;
for(j=d+1;j<=21252;j++)
if ((j%23==p)&&(j%28==e)&&(j%33==i)) break;
cout<<"Case "<<t<<": the next triple peak occurs in "<<j-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