Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Re:我改进了,还是不对。怎么回事?

Posted by frkstyc at 2006-09-27 21:48:53 on Problem 1006
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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator