| ||||||||||
| 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;
cin>>p>>e>>i>>d;
int temp;
if (p==-1||e==-1||i==-1||d==-1)
return 0;
int count=1;
int days;
p = p%23;
e = e%28;
i = i%33;
temp = i+33;
while (1)
{
if (temp%23==p&&temp%28==e)
{
days = temp-d;
if (days>21252)
days -= 21252;
cout<<"Case "<<count++<<": the next triple peak occurs in "<<days<<" days."<<endl;
cin>>p>>e>>i>>d;
if (p==-1||e==-1||i==-1||d==-1)
return 0;
p = p%23;
e = e%28;
i = i%33;
temp = i+33;
}
else temp = temp +33;
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator