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

请教大侠,帮改一下程序,不知为何总WA?

Posted by Jansci at 2006-07-28 21:50:35
#include<iostream>
#include<math.h>
#include<iomanip>

using namespace std;

int main()
{int p,e,i,d,m,n=0;
  while(cin>>p>>e>>i>>d)
  {n++;
  if((p!=-1)&&(e!=-1)&&(i!=-1)&&(d!=-1))
   
   {
        for(m=21252;m>0;m--)
         {if(((m-p)%23==0)&&((m-e)%28==0)&&((m-i)%33==0))
             { if(m-d<=0)
                cout<<"Case "<<n<<": the next triple peak occurs in "<<m-d+21252<<" days."
<<endl;
                else
           
                 cout<<"Case "<<n<<": the next triple peak occurs in "<<m-d<<" days."
<<endl;
               }
          }
    }
}

    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