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 |
有没有大佬帮我看看哇?哭惹!测试全过,一交就wa#include<iostream> #include<algorithm> #include<string.h> using namespace std; //Tzolkin周期为260天 struct Tzolkinday{ int day; char str[10]; }Td[261]; struct Haabday{ char str[10]; int index; }Hd[20]; int main() { char ss[20][20]={"imix","ik","akbal","kanan","chicchan","cimi","manik" ,"lamat","muluk","ok","chuen","eb","ben","ix","mem","cib","caban","eznab","canac","ahau"}; char sss[21][21]={"pop","no","zip","zotz","tzec","xul","yoxkin","mol" ,"chen","yax","zac","ceh","mac","kankin","muan","pax","koyab","cuhu","uayet"}; for(int i=1;i < 20;i++) { strcpy(Hd[i].str,sss[i-1]); Hd[i].index=Hd[i].str[0]+Hd[i].str[1]; } int n; int day; char month[10]; int year; cin >> n; while(n--) { char temp[15]; char lost[2]; int sumday=0; cin >> day >> lost; cin >> month >> year; int locate; int tempindex=month[0]+month[1]; for(int i=1;i < 20;i++)//找到这个月是第几个月 if(tempindex==Hd[i].index) { locate = i; break; } sumday=year*365+day+(locate-1)*20; int Tyear=sumday/260;//年 int xth=sumday%260+1;//日 cout << (xth-1)%13+1 << ' ' << ss[(xth-1)%20] << ' ' << Tyear << endl; } return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator