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.h> #include<string.h> void main() { int n; cin>>n; cout<<n<<endl; char *m[19]={"pop", "no", "zip", "zotz", "tzec", "xul", "yoxkin", "mol", "chen", "yax", "zac", "ceh", "mac", "kankin", "muan", "pax", "koyab", "cumhu", "uayet"}; char *mon[20]={ "imix", "ik", "akbal", "kan", "chicchan", "cimi", "manik", "lamat", "muluk", "ok", "chuen", "eb", "ben", "ix", "mem", "cib", "caban", "eznab", "canac", "ahau"}; int M[19]; for(int i=0;i<19;i++) {M[i]=20*i;} while(n) { n--; float dayOfH; int yearOfH,dayOfT,yearOfT,month; char monthOfH[6],monthOfT[6]; cin>>dayOfH>>monthOfH>>yearOfH; (int)dayOfH; int num=0; for(int i=0;i<19;i++) {if(strcmp(m[i],monthOfH)==0) num=i;} int sum=yearOfH*365+M[num]+dayOfH+1; yearOfT=sum/260; if(sum%260%20==0) strcpy(monthOfT,"ahau"); else { month=sum%260%20-1; strcpy(monthOfT,mon[month]); } dayOfT=sum%260%13; cout<<dayOfT<<" "<<monthOfT<<" "<<yearOfT<<" "<<endl; } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator