1008p
来源:互联网 发布:怎么看java源码 编辑:程序博客网 时间:2024/05/02 02:07
直接模拟
- //============================================================================
- // Name : 1008.cpp
- // Author : kevin
- // Version :
- // Copyright : copyright @ kevin
- // Description : Hello World in C++, Ansi-style
- //============================================================================
- #include <iostream>
- #include<string>
- using namespace std;
- int main()
- {
- int n;
- bool flag=true;
- string haab[19]={"pop","no","zip","zotz","tzec","xul","yoxkin","mol","chen","yax","zac","ceh","mac","kankin","muan","pax","koyab","cumhu","uayet"};
- string tzlo[20]={"imix","ik","akbal","kan","chicchan","cimi","manik","lamat","muluk","ok","chuen","eb","ben","ix","mem","cib","caban","eznab","canac","ahau"};
- int num[13]={1,8,2,9,3,10,4,11,5,12,6,13,7};
- cin>>n;
- int temp=n;
- while(temp--)
- {
- int day,year,total,i,current;
- string s0,month;
- cin>>day>>s0>>month>>year;
- for(i=0;i<20;++i)
- if(month.compare(haab[i])==0)
- break;
- total=day+i*20+year*365;
- int number,year1;
- string name;
- year1=total/260;
- number=total%260;
- name=tzlo[number%20];
- if(flag)
- {
- cout<<n<<endl;
- flag=false;
- }
- current=number/20;
- i=num[current];
- for(int j=0;j<(number%20);++j)
- {
- if(i%13==0)
- i=1;
- else
- ++i;
- }
- cout<<i<<" "<<name<<" "<<year1<<endl;
- }
- return 0;
- }