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 |
大神们来帮帮忙,为什么测试数据都过了,就是不能AC#include<iostream> #include<cstdio> #include<cstring> using namespace std; int main() { string Haab[18]={".pop",".no",".zip",".zotz",".tzec",".xul",".yoxkin",".mol",".chen",".yax",".zac",".ceh",".mac",".kankin",".muan",".pax",".koyab",".cumhu"}; string Tzolkin[20]={"imix","ik","akbal","kan","chicchan","cimi","manik","lamat","muluk","ok","chuen","eb","ben","ix","mem","cib","caban","eznab","canac","ahau"}; int rest; int i,j,k,sum; cin>>k; int *day=new int[k]; int *year=new int[k]; string *month=new string[k]; for(i=0;i<k;i++) cin>>day[i]>>month[i]>>year[i]; int *day1=new int [k]; int *year1=new int[k]; string *month1=new string[k]; while(i--) { rest=0; sum=0; if(month[i]==".uayet") sum=sum+year[i]*365+360+day[i]; else { for(j=0;j<19;j++) { if(month[i]==Haab[j]) break; } sum=sum+year[i]*365+20*j+day[i]; } year1[i]=sum/260; rest=sum%260; day1[i]=rest%13; month1[i]=Tzolkin[rest%20]; } cout<<k<<endl; for(i=0;i<k;i++) cout<<day1[i]+1<<" "<<month1[i]<<" "<<year1[i]<<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