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 chensentao at 2008-11-08 22:33:31 on Problem 1006
#include<iostream>
#include<math.h>
using namespace std;
int main()
{
	int a[4],j,day,num=1,i;
	for( i=0;i<4;i++)
		cin>>a[i];
	while((a[0]!=-1)&&(a[1]!=-1)&&(a[2]!=-1)&&(a[3]!=-1))
	{   j=0;
	    while((a[2]+33*j<a[1])&&(a[2]+33*j<a[0]))j++;
		while(((a[2]+33*j-a[1])%28)||((a[2]+33*j-a[0])%23))
		j++;
		if((a[0]==0)&&(a[1]==a[0])&&(a[2]==a[1]))
			cout<<"Case "<<num<<": the next triple peak occurs in "<<labs(21252-a[3])<<" days."<<endl;	 
		else{
		day=labs(a[2]+33*j-a[3]);
		if(day!=0)
		cout<<"Case "<<num<<": the next triple peak occurs in "<<day<<" days."<<endl;
		else
			cout<<"Case "<<num<<": the next triple peak occurs in "<<21252+a[3]<<" days."<<endl;}	 
        for( i=0;i<4;i++)
		cin>>a[i];
		num++;
	}
	return 1;
}

	

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