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

哪位大哥帮我看一下啊

Posted by yangjie at 2005-04-23 20:24:31 on Problem 1006
#include <iostream>
using namespace std;
void main()
{	
	int *M;	
	int p,e,i,d;
	cin>>p>>e>>i>>d;
	for(int m=0,j=0;p!=-1&&e!=-1&&i!=-1&&d!=-1;m++,j++)
	{
		M=new int[j];
     if(((m+p)%23==0)&&((m+e)%28==0)&&((m+i)%33==0))
	    M[j]=m; 
	cin>>p>>e>>i>>d;
	}
	for (int n=0;n<j;n++)
    cout<<"Case"<<' '<<n<<":"<<' '<<"the next triple occurs in"<<' '<<(21252-M[n]-d)<<' '<<"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