Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
求大神看看,测试用例和自己写的边界测试都没有问题,但是错了#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator