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 |
那位牛人能救救我!!!!!!!!!我真不知道自己错在哪???求求各位高手了!!!看看这个程序吧!!!#include<iostream> #include<string> using namespace std; void main() { long *day,*year,i,n,j; long Ty,Td,Tzd1,Nd(0),Tzd2; char p; char* Haab[19]= {"pop","no","zip", "zotz", "tzec", "xul", "yoxkin", "mol", "chen", "yax", "zac", "ceh", "mac", "kankin", "muan", "pax", "koyab", "cumhu","uayet"}; char*Tzolkin[20]= {"ahau","imix", "ik", "akbal", "kan", "chicchan", "cimi", "manik", "lamat", "muluk", "ok", "chuen", "eb", "ben", "ix", "mem", "cib", "caban", "eznab", "canac"}; string *mon; cin>>n; day=new long[n]; year=new long[n]; mon=new string[n]; for(i=0;i<n;i++) { cin>>day[i]>>p>>mon[i]>>year[i]; } cout<<n<<endl; for(i=0;i<n;i++) { for(j=0;j<19;j++) { if(mon[i]==Haab[j]) {Nd=j*20;} } Nd=Nd+year[i]*365+day[i]+1; Ty=(Nd-1)/260; Td=(Nd%260); Tzd2=Td%20; if(Td%13!=0) { Tzd1=Td%13;} else{Tzd1=13;} cout<<Tzd1<<ends<<Tzolkin[Tzd2]<<ends<<Ty<<endl; } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator