| ||||||||||
| 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:kkmmnn at 2006-09-27 20:54:56 364 364 364 365
> #include<iostream>
> using namespace std;
> int main()
> {
> int p,e,i,d,x,n;
> cin>>p>>e>>i>>d;
> x=i;n=1;
> while(p!=-1&&e!=-1&&i!=-1&&d!=-1)
> {
> while(!((x-p)%23==0&&(x-e)%28==0))
> x+=33;
> if(p==e&&i==e&&p==i&&d==p)
> cout<<"Case "<<n<<": the next triple peak occurs in "<<21252<<" days."<<endl;
> else
> {
> if(x!=0)
> cout<<"Case "<<n<<": the next triple peak occurs in "<<x-d<<" days."<<endl;
> else
> cout<<"Case "<<n<<": the next triple peak occurs in "<<21252-d<<" days."<<endl;
> }
> n++;
> cin>>p>>e>>i>>d;
> x=i;
> }
> return 0;
> }
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator