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:chensentao at 2008-11-08 22:33:31 > #include<iostream> > #include<math.h> > using namespace std; > int main() > { > int a[4],j,day,num=1,i; > for( i=0;i<4;i++) > cin>>a[i]; > while((a[0]!=-1)&&(a[1]!=-1)&&(a[2]!=-1)&&(a[3]!=-1)) > { j=0; > while((a[2]+33*j<a[1])&&(a[2]+33*j<a[0]))j++; > while(((a[2]+33*j-a[1])%28)||((a[2]+33*j-a[0])%23)) > j++; > if((a[0]==0)&&(a[1]==a[0])&&(a[2]==a[1])) > cout<<"Case "<<num<<": the next triple peak occurs in "<<labs(21252-a[3])<<" days."<<endl; > else{ > day=labs(a[2]+33*j-a[3]); > if(day!=0) > cout<<"Case "<<num<<": the next triple peak occurs in "<<day<<" days."<<endl; > else > cout<<"Case "<<num<<": the next triple peak occurs in "<<21252+a[3]<<" days."<<endl;} > for( i=0;i<4;i++) > cin>>a[i]; > num++; > } > return 1; > } > > Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator