//============================================================================
// Name : 1008.cpp
// Author :
// Version :
// Copyright : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================
#include <iostream>
#include <string>
#include <map>
using namespace std;
string haabs[] = { "pop", "no", "zip", "zotz", "tzec", "xul", "yoxkin", "mol",
"chen", "yax", "zac", "ceh", "mac", "kankin", "muan", "pax", "koyab",
"cumhu", "uayet" };
string tzo[] = { "imix", "ik", "akbal", "kan", "chicchan", "cimi", "manik",
"lamat", "muluk", "ok", "chuen", "eb", "ben", "ix", "mem", "cib",
"caban", "eznab", "canac", "ahau" };
map<string, int> haabMap;
void initHaabMonth() {
for (int i = 0; i < 19; i++) {
haabMap[haabs[i]] = i;
}
}
int main() {
ios::sync_with_stdio(false);
initHaabMonth();
int t;
cin >> t;
cout << t << endl;
while (t--) {
int day, year, month;
char ch;
string mon;
cin >> day >> ch >> mon >> year;
month = haabMap[mon];
int days = year * 365 + month * 20 + day;
int nday, nyear, nmonth;
nyear = days / 260;
int mod = days % 260;
nday = mod % 13 + 1;
nmonth = mod % 20;
cout << nday << " " << tzo[nmonth] << " " << nyear << endl;
}
return 0;
}
poj1008
最新推荐文章于 2019-05-05 20:40:03 发布