| ||||||||||
| 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 | |||||||||
帮忙看看 我用加33的就是通不过 #include<iostream>
using namespace std;
int main()
{
int p, e, i, d;
int k, t=0;
while (cin >> p >> e >> i >> d
&& (p!=-1 || e!=-1 || i!=-1 || d!=-1))
{
p = p%23;
e = e%28;
i = i%33;
k = d - d%33;
t++;
while(k <= 21252+d)
{
k += 33;
if((k-p)%23==0 && (k-e)%28==0)
{
break;
}
}
cout<<"Case "<<t<<": the next triple peak occurs in "<<k-d<<" days.\n";
}
return 0;
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator