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 eorr

Posted by xueshanhaizi at 2007-08-21 17:14:55 on Problem 1008
# include <iostream>
# include <string>
using namespace std;
int main(){
	int n,sum,i;
	int d,y,td,tm,ty;	
	string m;
	char  *haab[20]={"pop","no","zip","zotz","tzec","xul","yoxkin","mol","chen"
		,"yax","zac","ceh","mac","kankin","muan","pax","koyab","cumhu","uayet"};
    char  *zolkin[20]={"imix","ik","akbal","kan","chicchan","cimi","manik","lamat"
		,"muluk","ok","chuen","eb","ben","ix","mem","cib","caban","eznab","canac","ahau"};
	cin>>n;
	cout<<n<<endl;;
	while(n--)
	{
		cin>>d;
		cin.ignore();
	    cin>>m>>y;
		for( i=0;i<19;i++){
			if(strcmp(m.c_str(),haab[i])==0)
			{
			sum=0;
			sum=y*365+i*20+d+1;
			ty=sum/260;
			tm=sum%20;
			td=sum%13;
			cout<<td<<" "<<zolkin[tm-1]<<" "<<ty<<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