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

救命啊,为什么老是Run Time Error啊????

Posted by thincal at 2004-05-04 18:12:55 on Problem 1008
#include<iostream.h>
#include<string.h>
#include<stdio.h>
#define MAX 10000 
typedef struct
{
	int data;
	char mth[10];
	int yr;
}hollytype;

char Haab[19][10]={"pop","no","zip","zotz","tzec","xul",
	 "yoxkin","mol","chen","yax","zac","ceh","mac","kankin",
	 "muan","pax","koyab","cumhu","uayet"}; 
 char Tzolkin[20][10]={"imix","ik","akbal","kan","chicchan",
	 "cimi","manik","lamat", "muluk","ok","chuen","eb",
	 "ben","ix","mem","cib","caban","eznab","canac","ahau"}; 
void main()
{
	int n,i,d,y,count;
	char st[10];
	hollytype holly[MAX];   
	cin>>n;
	for(i=0;i<n;i++)
	{
		int j=0;
		scanf("%d. %s %d",&d,st,&y);

		while(strcmp(st,Haab[j]))
		{
			j++;
		    if(j>18)
				break;
		}
		if(j<=18)
		{
			count=d+j*20+y*365;
		    holly[i].data=count%13+1;
		    strcpy(holly[i].mth,Tzolkin[count%20]);
		    holly[i].yr=count/260;
		}
		else 
			break;
	}
	cout<<n<<endl;
	for(i=0;i<n;i++)
		cout<<holly[i].data<<" "<<holly[i].mth<<" "<<holly[i].yr<<endl;
}







		

	
	


















	 
		 

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