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

dadas

Posted by y05zxd at 2006-03-07 20:55:36 on Problem 1006
#include <iostream.h>
void main()
{ int j=0,n;
  int *p=new int[];
  int *e=new int[];
  int *i=new int[];
  int *d=new int[];
  int *z=new int[];
  do {j++;
	  cin>>p[j]>>e[j]>>i[j]>>d[j];
  }while(p[j]!=-1&&e[j]!=-1&&i[j]!=-1&&d[j]!=-1);
  n=j;
   for(j=1;j<n;j++)
   {int l;
for(l=1;l<1000;l++)
{ z[j]=p[j]+l*23-d[j];
if(((p[j]+l*23-e[j])%28==0)&&((p[j]+l*23-i[j])%33==0))break;}
   }
  
   for(j=1;j<n;j++)
   cout<<"Case "<<j<<":"<<"the next triple peak occurs in "<<z[j]<<" days."<<endl;
}

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