题目:http://poj.org/problem?id=1008
AC代码(C++):
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <string>
using namespace std;
int main(){
int n;
int* m;
cin>>n;
m = new int[n];
for(int i = 0; i < n; i++){
int dd;
int mm;
int yy;
char str[10];
scanf("%d. %s %d",&dd,&str,&yy);
string strs = str;
if(strs.compare("pop")==0){
mm = 0;
}
else if(strs.compare("no")==0){
mm = 1;
}
else if(strs.compare("zip")==0){
mm = 2;
}
else if(strs.compare("zotz")==0){
mm = 3;
}
else if(strs.compare("tzec")==0){
mm = 4;
}
else if(strs.compare("xul")==0){
mm = 5;
}
else if(strs.compare("yoxkin")==0){
mm = 6;
}
else if(strs.compare("mol")==0){
mm = 7;
}
else if(strs.compare("chen")==0){
mm = 8;
}
else if(strs.compare("yax")==0){
mm = 9;
}
else if(strs.compare("zac")==0){
mm = 10;
}
else if(strs.compare("ceh")==0){
mm = 11;
}
else if(strs.compare("mac")==0){
mm = 12;
}
else if(strs.compare("kankin")==0){
mm = 13;
}
else if(strs.compare("muan")==0){
mm = 14;
}
else if(strs.compare("pax")==0){
mm = 15;
}
else if(strs.compare("koyab")==0){
mm = 16;
}
else if(strs.compare("cumhu")==0){
mm = 17;
}
else if(strs.compare("uayet")==0){
mm = 18;
}
m[i] = yy*365 + mm*20 + dd;
}
cout<<n<<endl;
for(int i = 0; i < n; i++){
cout<<m[i]%13+1<<" ";
if(m[i]%20+1==1){
cout<<"imix ";
}
else if(m[i]%20+1==2){
cout<<"ik ";
}
else if(m[i]%20+1==3){
cout<<"akbal ";
}
else if(m[i]%20+1==4){
cout<<"kan ";
}
else if(m[i]%20+1==5){
cout<<"chicchan ";
}
else if(m[i]%20+1==6){
cout<<"cimi ";
}
else if(m[i]%20+1==7){
cout<<"manik ";
}
else if(m[i]%20+1==8){
cout<<"lamat ";
}
else if(m[i]%20+1==9){
cout<<"muluk ";
}
else if(m[i]%20+1==10){
cout<<"ok ";
}
else if(m[i]%20+1==11){
cout<<"chuen ";
}
else if(m[i]%20+1==12){
cout<<"eb ";
}
else if(m[i]%20+1==13){
cout<<"ben ";
}
else if(m[i]%20+1==14){
cout<<"ix ";
}
else if(m[i]%20+1==15){
cout<<"mem ";
}
else if(m[i]%20+1==16){
cout<<"cib ";
}
else if(m[i]%20+1==17){
cout<<"caban ";
}
else if(m[i]%20+1==18){
cout<<"eznab ";
}
else if(m[i]%20+1==19){
cout<<"canac ";
}
else if(m[i]%20+1==20){
cout<<"ahau ";
}
cout<<m[i]/260<<endl;
}
}
总结:水题