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

为什么又runtime erro ?

Posted by 15920496452 at 2008-03-21 15:15:30 on Problem 1008
#include"iostream"
using namespace std;
int main()
{
	int a,i,j;
	long day[100],mon[100],year[100];
	char h[20][10]={"pop", "no", "zip", "zotz", 
		"tzec", "xul", "yoxkin", "mol", "chen", 
		"yax", "zac", "ceh", "mac", "kankin", "muan", "pax", "koyab", "cumhu","uayet"};
	char date[20][10]={"imix", "ik", "akbal", "kan", "chicchan", 
		"cimi", "manik", "lamat", "muluk", "ok", 
		"chuen", "eb", "ben", "ix", "mem", "cib", "caban", "eznab", "canac", "ahau"};
	char m[10],d;
	cin>>a;
	for(i=0;i<a;i++)
	{
		cin>>day[i]>>d>>m>>year[i];
		for(j=0;j<=18;j++)
			if(strcmp(m,h[j])==0)mon[i]=j;
			day[i]=day[i]+1+mon[i]*20+year[i]*365;
	}
	cout<<a<<endl;
	for(i=0;i<a;i++)
	{
		cout<<day[i]%13<<" ";
	cout<<date[day[i]%20-1]<<" ";
	cout<<day[i]/260<<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