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 |
各位大侠们,为什么我的能过去给的example还是WA呢?#include<stdio.h> #include<string.h> main() { long days; int i,j,n,yHaab,dHaab,dTzolkin,dTzolkins[13]={1,2,3,4,5,6,7,8,9,10,11,12,13}; char c,mHaab[7],mHaabs[19][6]={"pop","no","zip","zotz","tzec","xul","yoxkin","mol","chen","yax","zac","ceh","mac","kankin","muan","pax","koyab","cumhu","uayet"}; char mTzolkins[20][9]={"imix","ik","akbal","kan","chicchan","cimi","manik","lamat","muluk","ok","chuen","eb","ben","ix","mem","cib","caban","eznab","canac","ahau"}; scanf("%d",&n);printf("%d\n",n); for(i=0;i<n;i++) { days=0; scanf("%d%c %s %d",&dHaab,&c,mHaab,&yHaab); days+=365*yHaab; for(j=0;j<19;j++) { if(strcmp(mHaab,mHaabs[j])==0)break; if(j==18)days+=5; else days+=20; } days+=dHaab; dTzolkin=dTzolkins[days%13]; printf("%d %s %d\n",dTzolkin,mTzolkins[days%20],days/260); } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator