| ||||||||||
| 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 | |||||||||
我觉得没错呀?帮忙看下……#include<iostream>
#include<vector>
using namespace std;
int main(){
vector<int> b(4,1),days;
while(b[0]!=-1){
for(int j=0;j<4;j++)
cin>>b[j];
int p=0,e=0,d=0;
for(int n=1;n<21252/33;n++){
p=b[0]+23*n;
e=b[1]+28*n;
d=b[2]+33*n;
if(p==e && p==d && p+b[3]<21252){
e=21252-b[3]-p;
days.push_back(e);
n=21252;
}
}
}
for(unsigned int i=0;i<days.size();i++)
cout<<"Case "<<i+1<<": the next triple peak occurs in "<<days[i]<<" days."<<"\n";
return 1;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator