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<list> using namespace std; int main() { int a,b,c,d,i=1; list< int > v; while(true) { cin>>a>>b>>c>>d; if(a==-1) break; v.push_back(a%23); v.push_back(b%28); v.push_back(c%33); v.push_back(d); } while(!v.empty()) { a=v.front(); v.pop_front(); b=v.front(); v.pop_front(); c=v.front(); v.pop_front(); d=v.front(); v.pop_front(); int e=d; while(true) { d=d+1; if((d-a)%23==0&&(d-b)%28==0&&(d-c)%33==0) break; } cout<<"Case "<<i<<": the next triple peak occurs in"<<d-e<<"day."<<endl; i=i+1; } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator