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<cstring> using namespace std; int main() { int n; char h[19][10]={"pop", "no", "zip", "zotz", "tzec", "xul", "yoxkin", "mol", "chen", "yax", "zac", "ceh", "mac", "kankin","muan", "pax", "koyab", "cumhu","uayet"}; char t[20][10]={"imix", "ik", "akbal", "kan", "chicchan", "cimi", "manik", "lamat", "muluk", "ok", "chuen", "eb", "ben", "ix", "mem", "cib", "caban", "eznab", "canac", "ahau"}; int hd,hy,td,ty; char hm[10],tm[10]; int i,j,a,d; char c; cin>>n; for(j=0;j<n;j++) { scanf("%d%*s %s %d",&hd,hm,&hy); for(i=0;i<19;i++) { if(strlen(hm)==strlen(h[i])) { if(strcmp(hm,h[i])==0)break; } } d=hy*365+i*20+hd+1; if(d%13==0) td=13; else td=d%13; if(d%260==0) ty=d/260-1; else ty=d/260; if(d%20==0) a=20; else a=d%20; strcpy(tm,t[a-1]); cout<<td<<" "; printf("%s ",tm); cout<<ty<<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