| ||||||||||
| 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 | |||||||||
我AC不了,help(新手)#include <iostream>
#include <vector>
using namespace std;
int main()
{
int p,e,i,d;
vector<int> vp,ve,vi,vd;
unsigned int k;
int count=1;
while(1)
{
cin>>p>>e>>i>>d;
if(p==-1&&e==-1&&i==-1&&d==-1)
break;
vp.push_back(p%23);
ve.push_back(e%28);
vi.push_back(i%33);
vd.push_back(d);
}//end of input
for(k=0;k<vd.size();k++)
{
for(int j=1;j<=21252;j++)
{
if((vd[k]+j)%23==vp[k]&&(j+vd[k])%28==ve[k]&&(j+vd[k])%33==vi[k])
{
cout<<"case "<<count++<<": the next triple peak occurs in "
<<j<<" days."<<endl;
break;
}
}
}
return 0;
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator