| ||||||||||
| 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 | |||||||||
为什么我的程序输出是正确的却通不过啊。高手帮忙一下1006题目
#include<iostream>
using namespace std;
int main(int argc, char* argv[])
{
int p,e,i,d,m=1;
cin>>p>>e>>i>>d;
while(p!=-1&&e!=-1&&i!=-1&&d!=-1)
{
for(int j=1; ;j++)
{
if((23*j+p-e)%28==0&&(23*j+p-i)%33==0)
{
cout<<"case "<<m++<<": the next triple peak occurs in "<<(23*j+p-d)<<" days."<<endl;
break;
}
}
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