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
北京大学暑期课《ACM/ICPC竞赛训练》面向全球招生!

求大神看看,测试用例和自己写的边界测试都没有问题,但是错了

Posted by tanlan at 2017-09-13 14:52:10 on Problem 1008
#include <iostream>
#include <string>
using namespace std;

const char *Haab[19]    = { "pop", "no", "zip", "zotz", "tzec", "xul", "yoxkin", "mol", "chen", "yax", "zac", "ceh", "mac", "kankin", "muan", "pax", "koyab", "cumhu", "uayet" };
const char *Tzolkin[20] = { "imix", "ik", "akbal", "kan", "chicchan", "cimi", "manik", "lamat", "muluk", "ok", "chuen", "eb", "ben", "ix", "mem", "cib", "caban", "eznab", "canac", "ahau" };
int main()
{
	int num;
	cin >> num;
	for (int curDate = 0; curDate < num; curDate++)
	{
		float dayinput;
		string mouthinput;
		int year;
		cin >> dayinput >> mouthinput >> year;
		int day = dayinput;
		int countDay = year * 365 + day;
		for (int i = 0; i < 18; i++)
		{
			if (mouthinput == Haab[i])
			{
				break;
			}
			else{
				countDay += 20;
			}
		}
		int yearTzolkin = countDay / 260;
		int mouthTzolkin = countDay % 260 % 20;
		int DayTzolkin = 1 + countDay % 260 % 13;
		cout << DayTzolkin << ' ' << Tzolkin[mouthTzolkin] << ' ' << yearTzolkin << 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