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 Error场????

Posted by zhangjunjie8412 at 2005-08-17 15:53:55 on Problem 1008
#include<iostream>
#include<string>
using namespace std;
string C[19]={"0.","1.","2.","3.","4.","5.","6.","7.","8.","9.","10.","11.","12.",
               "13.","14.","15.","16.","17.","18."};
string A[19]={"pop", "no", "zip", "zotz", "tzec", "xul", "yoxkin","mol","chen",
              "yax", "zac", "ceh", "mac", "kankin", "muan", "pax", "koyab", "cumhu", "uayet"};
string B[20]={"imix", "ik", "akbal", "kan", "chicchan", "cimi", "manik","lamat", 
             "muluk","ok", "chuen", "eb", "ben","ix", "mem", "cib", "caban","eznab", "canac", "ahau"};
void Maya(string day,string month,int year)
{
	for(int j=0;j<19;j++)
	{
		if(day==C[j]) break;
	}
	for(int k=0;k<19;k++)
	{
		if(month==A[k]) break;
	}
	int total=year*365+k*20+(j+1);
	int year2=total/260;
	int number=total%13;
	int day2=(total%260)%20-1;
	cout<<number<<" "<<B[day2]<<" "<<year2<<endl;
}
void main()
{
	int n;
	string str_day[10];
	string str_mon[10];
	int    year[10];
	cin>>n;
	for(int i=0;i<n;i++)
		cin>>str_day[i]>>str_mon[i]>>year[i];
	cout<<n<<endl;
	for(i=0;i<n;i++)
		Maya(str_day[i],str_mon[i],year[i]);
}



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