Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
Re:注意这组数据——好东东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: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator