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 |
求大佬看一下为何答案一直是Presentation Error代码这么写的 给出的测试用例也都能通过 #include<iostream> #include<string.h> using namespace std; int haab2day(char a[],int d,int y) { if(strcmp(a,"pop")==0) return d+20*0+y*365; if(strcmp(a,"no")==0) return d+20*1+y*365; if(strcmp(a,"zip")==0) return d+20*2+y*365; if(strcmp(a,"zotz")==0) return d+20*3+y*365; if(strcmp(a,"tzec")==0) return d+20*4+y*365; if(strcmp(a,"xul")==0) return d+20*5+y*365; if(strcmp(a,"yoxkin")==0) return d+20*6+y*365; if(strcmp(a,"mol")==0) return d+20*7+y*365; if(strcmp(a,"chen")==0) return d+20*8+y*365; if(strcmp(a,"yax")==0) return d+20*9+y*365; if(strcmp(a,"zac")==0) return d+20*10+y*365; if(strcmp(a,"ceh")==0) return d+20*11+y*365; if(strcmp(a,"mac")==0) return d+20*12+y*365; if(strcmp(a,"kankin")==0) return d+20*13+y*365; if(strcmp(a,"muan")==0) return d+20*14+y*365; if(strcmp(a,"pax")==0) return d+20*15+y*365; if(strcmp(a,"koyab")==0) return d+20*16+y*365; if(strcmp(a,"cumhu")==0) return d+20*17+y*365; if(strcmp(a,"uayet")==0); return d+20*18+y*365; return 0; } void day2t(int x) int d,m,y; char mm[20][10]={"imix", "ik", "akbal"," kan","chicchan","cimi","manik", "lamat","muluk","ok","chuen","eb","ben","ix","mem","cib","caban","eznab","canac", "ahau"}; y=x/260; x=x%260; m=x%20; d=x%13+1; cout<<d<<' '<<mm[m]<<' '<<y<<endl; //输出 return; } int main() { int n; char a[10]; int d,y; int day; char dot; while(cin>>n) { if(n==0) return 0; cout<<n<<endl; for(int i=1;i<=n;i++) { cin>>d>>dot>>a>>y; day=haab2day(a,d,y); day2t(day); } } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator