首页 > 代码库 > poj1008
poj1008
#include<iostream> #include<string> using namespace std; int n; int day,year; char month[10]; char haab[19][7]={"pop", "no", "zip", "zotz", "tzec", "xul", "yoxkin", "mol", "chen", "yax", "zac", "ceh", "mac", "kankin", "muan", "pax", "koyab", "cumhu","uayet"}; char tzolkin[20][9]={"imix", "ik", "akbal", "kan", "chicchan", "cimi", "manik", "lamat", "muluk", "ok", "chuen", "eb", "ben", "ix", "mem", "cib", "caban", "eznab", "canac", "ahau" }; int main() { //freopen("input.txt","r",stdin); cin>>n; cout<<n<<endl; while(n--) { scanf("%d. %s %d",&day,month,&year); int monthnum=0,total=0; for(int i=0;i<19;i++) if (strcmp(haab[i],month)==0) monthnum=i; total=year*365+monthnum*20+day+1; //cout<<total<<endl; if(total%13==0) cout<<13<<‘ ‘; else cout<<total%13<<‘ ‘; if(total%20==0) cout<<tzolkin[19]<<‘ ‘; else cout<<tzolkin[total%20-1]<<‘ ‘; if(total%260==0) cout<<total/260-1<<endl; else cout<<total/260<<endl; } return 0; }
poj1008
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。