| ||||||||||
| 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 | |||||||||
测试数据过了 但一直是 WA 群里的特殊数据我的也是正确的。。十分蛋疼#include <iostream>
#include <string>
using namespace std;
const string haab[18]={"pop","no", "zip", "zotz", "tzec", "xul", "yoxkin", "mol", "chen", "yax", "zac", "ceh", "mac", "kankin", "muan", "pax", "koyab", "cumhu"};
const string 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 lines;
cin>>lines;
int count=1;
cout<<lines<<endl;
while (count<=lines)
{
string day;
string month;
int years;
int mon;
int d;
cin>>day>>month>>years;
if (years>=5000)
break;
d=atoi(day.substr(0,day.length()).c_str());
if (month=="uayet"){
mon=18;
}
else{
for (int i=0;i<18;i++)
{
if (month==haab[i])
{
mon=i;
break;
}
}
count++;
}
long days = years*365 +mon*20+d;
// convert to tzolkin
int tzyear= days/260;
int tzdays= days%260;
int tzday= tzdays%13;
int tzmonth= tzdays%20;
cout<<tzday+1<< " "<<Tzolkin[tzmonth]<<" "<<tzyear<<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