Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
Register

## Re:注意这组数据——好东东

Posted by wlys111 at 2007-05-03 11:14:49 on Problem 1008
In Reply To:注意这组数据 Posted by:bergkamp at 2006-08-04 20:38:33
```> 4. uayet 259
> 正解是 13 ahau 364
> 而不是13 ahau 365
> 看看你的程序是不是 少了点情况没考虑  ：）
> cout 和 printf都可以AC

#include <iostream>
using namespace std;

void main()
{
int count;
cin>>count;
cout<<count<<endl;
char mounth[15];
char map[40] = "lllinnmmmpppppssrrjkhbbaaaocccccgddddfe";
char *mounth2[20] = { "imix", "ik", "akbal", "kan", "chicchan", "cimi", "manik", "lamat", "muluk", "ok", "chuen", "eb", "ben", "ix", "mem", "cib", "caban", "eznab", "canac", "ahau"};

while( count-- ) {
int day,year;
cin>>day>>mounth>>mounth>>year;
int m = map[mounth[0]+mounth[1]-200] - 'a';
if(m == 9 && mounth[0] == 'k')
m = 16;
long days = 365*year + m*20 +day;//没有判断输入的格式
year = days/260;
day = days%260;
m = day%20;
day = day%13+1;
cout<<day<<" "<<mounth2[m]<<" "<<year<<endl;
}
}
```

Followed by: