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

为什么RunTimeError???

Posted by yangno1 at 2010-01-16 15:28:28
高手们帮忙看看吧!
#include<iostream>
using namespace std;
struct YandD{
	int Years;
	int Days;
};
int main()
{
	int p,e,i,d;
	struct YandD a[1000],b[800],c[700];
	int ZC[100];
	int zcL=0;
	for(cin>>p>>e>>i>>d;p!=-1;)
	{
		p=p%23;
		e=e%28;
		i=i%33;
		int x=0,y,z;
		for(x=1;(p+23*x)<=21252+d;x++)
		{
			a[x-1].Years=(p+23*x)/365;
			a[x-1].Days=(p+23*x)%365;
		}
		for(y=1;(e+28*y)<=(21252+d);y++)
		{
			b[y-1].Years=(e+28*y)/365;
			b[y-1].Days=(e+28*y)%365;
		}
		for(z=1;(i+33*z)<=(21252+d);z++)
		{
			c[z-1].Years=(i+33*z)/365;
			c[z-1].Days=(i+33*z)%365;
		}
		int n=0,m=0,q=0;
		for(;n<x-1;n++)
		{
			for(m=0;m<y-1;m++)
			{
				if(a[n].Years==b[m].Years)
				{
					if(a[n].Days==b[m].Days)
					{
						for(q=0;q<z-1;q++)
						{
							if(a[n].Years==c[q].Years)
							{
								if(a[n].Days==c[q].Days&&(365*a[n].Years+a[n].Days)>d)
								{
									ZC[zcL]=365*a[n].Years+a[n].Days-d;
									zcL++;
									goto Label;
								}
							}
						}
					}
				}
			}
		}
Label:
		fflush(stdin);
		cin>>p>>e>>i>>d;
	}
	for(int temp=0;temp<zcL;temp++)
		cout<<"Case "<<temp+1<<": the next triple peak occurs in "<<ZC[temp]<<" 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