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 |
那位仁兄帮帮忙啊,狂查5小时还是WA#include <iostream.h> #include <stdio.h> #include <string.h> char m1[19][9]={"pop", "no", "zip", "zotz", "tzec", "xul", "yoxkin", "mol","chen", "yax", "zac", "ceh", "mac", "kankin", "muan", "pax", "koyab", "cumhu","uayet"}; char m2[20][9]={ "imix", "ik", "akbal", "kan", "chicchan", "cimi", "manik", "lamat", "muluk", "ok", "chuen", "eb", "ben", "ix", "mem", "cib", "caban", "eznab", "canac", "ahau"}; void main() { int n; cin>>n; cout<<n<<endl; for(int y=0;y<n;y++) { long int day1,year1,sum,i; char month1[7]; scanf("%d. %s %d",&day1,month1,&year1); for(i=0;i<19;i++) { if(strcmp(m1[i],month1)==0) break; } sum=year1*365+i*20+day1; printf("%d %s %d\n",1+sum%13,m2[sum%20],sum/260); } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator