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 Saleed at 2016-04-15 14:57:04 on Problem 1008
In Reply To:Re:注意这组数据——好东东 Posted by:wlys111 at 2007-05-03 11:14:49
```>
> 好的测试数据，我居然把最后一个月落下了，哈哈……
> 作为反馈，贴上我的垃圾代码，请大家指点（Accepted 132K 15MS C++ 728B ）：
> #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;
> 	}
> }

> 		int m = map[mounth[0]+mounth[1]-200] - 'a';
> 		if(m == 9 && mounth[0] == 'k')
> 			m = 16;

```

Followed by: