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 dash007 at 2010-12-06 21:22:28
#include <iostream>
using namespace std;
#define MAX 10
struct BIORHYTHMS
{
	int PHY;
	int EMO;
	int INTE;
	int DATE;
	int result;
}BIO[MAX];

int main()
{
	int count=0;
	int i=-1;
	
	do
	{
		i++;
		cin>>BIO[i].PHY>>BIO[i].EMO>>BIO[i].INTE>>BIO[i].DATE;
		BIO[i].result=(5544*BIO[i].PHY+14421*BIO[i].EMO+1288*BIO[i].INTE-BIO[i].DATE+21252)%21252; 
		if(BIO[i].result==0)
		{
			BIO[i].result=21252;
		}			
	}while((BIO[i].PHY!=-1 && BIO[i].EMO!=-1 && BIO[i].INTE!=-1 && BIO[i].DATE!=-1));
	for(int j=0;j<i;j++)
	{	
		cout <<"Case"<< j+1 <<" : the next triple peak occurs in " <<BIO[j].result<<" 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