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 "stdio.h" #include "stdlib.h" #include "string.h" int trans(char* s) { if(strcmp(s,"pop")==0) return 0; if(strcmp(s,"no")==0) return 20; if(strcmp(s,"zip")==0) return 40; if(strcmp(s,"zotz")==0) return 60; if(strcmp(s,"tzec")==0) return 80; if(strcmp(s,"xul")==0) return 100; if(strcmp(s,"yoxkin")==0) return 120; if(strcmp(s,"mol")==0) return 140; if(strcmp(s,"chen")==0) return 160; if(strcmp(s,"yax")==0) return 180; if(strcmp(s,"zac")==0) return 200; if(strcmp(s,"ceh")==0) return 220; if(strcmp(s,"mac")==0) return 240; if(strcmp(s,"kankin")==0) return 260; if(strcmp(s,"muan")==0) return 280; if(strcmp(s,"pax")==0) return 300; if(strcmp(s,"koyab")==0) return 320; if(strcmp(s,"cumhu")==0) return 320; if(strcmp(s,"uayet")==0) return 360; } char* a[20]={"imix","ik","akbal","kan","chicchan","cimi","manik","lamat","muluk","ok","chuen","eb","ben","ix","mem","cib","caban","eznab","canac","ahau"}; int main() { int n,i,day,NumberOfTheDay,Year,sum; char Month[10]; scanf("%d",&n); printf("%d\n",n); for(i=0;i<n;i++) { scanf("%d.%s %d",&NumberOfTheDay,Month,&Year); sum=Year*365+trans(Month)+NumberOfTheDay; day=sum%260; printf("%d %s %d\n",day%13+1,a[day%20],sum/260); } //system("pause"); return 0; } 为啥会是WA呢?所有给的数据都通过了。 Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator