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

我测试的数据都对但是,提交的时候就是不行...高手帮帮忙......c++的.

Posted by sky_my001 at 2006-10-19 17:43:35 on Problem 1006
#include "stdafx.h"
#include <iostream.h>

int main()
{long int p,e,i;
int key=0,d[50];
int n=21252,sum[50];


while(1)
{	key++;
cin>>p>>e>>i>>d[key];
	if((p==e)&&(e==i)&&(i==d[key])&&(d[key]==-1))
			break;
	if((p==e)&&(e==i))
		{sum[key]=n+p;}


	else{while((p!=e)||(e!=i))
			{if(p<=e&&p<=i)p=p+23;
			 else if(e<=p&&e<=i)
				e=e+28;
			 else if((i<=p)&&(i<=e))
						i=i+33;
	}
		sum[key]=p;
		}
	
 }

 

for(i=1;i<key;i++)
{if(sum[i]-d[i]>n)
cout<<"Case"<<i<<": the next triple peak occurs in "<<((sum[i]-d[i])%n)<<" days."<<endl;
else
cout<<"Case "<<i<<": the next triple peak occurs in "<<sum[i]-d[i]<<" 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