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 |
Re:帮忙找错 谢谢In Reply To:帮忙找错 谢谢 Posted by:kelven at 2006-05-28 13:16:00 > #include <iostream> > using namespace std; > int main(){ > int days[1000];int num=0; > int a,b,c,d; > while(cin>>a>>b>>c>>d) > { > if(a==-1&&b==-1&&c==-1&&d==-1) > break; > else > { > do{ > if(a<=b&&a<=c) > a+=23; > else if(b<=a&&b<=c) > b+=28; > else if(c<=b&&c<=a) > c+=33; > }while(a!=b||a!=c); > days[num]=a-d; > num++; > }} > for(int i=0;i<num;i++) > cout<<"Case "<<(i+1)<<": the next triple peak occurs in "<<days[i]<<" days."<<endl; > return 0; Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator