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 |
都无语了,所有的测试数据都过了就是WA,哪位高手看看错哪了?万分感谢!!!!!!!!!!!#include<iostream> #include<string> #include<malloc.h> #include<vector> using namespace std; int main() { long int i,N,year,k,j; long int *sum; string s[]={"pop","no", "zip", "zotz", "tzec", "xul", "yoxkin", "mol", "chen", "yax", "zac", "ceh", "mac", "kankin", "muan","pax", "koyab", "cumhu","uayet"}; string s1[]={"imix", "ik", "akbal", "kan", "chicchan", "cimi", "manik", "lamat", "muluk", "ok", "chuen", "eb", "ben", "ix", "mem", "cib", "caban", "eznab", "canac", "ahau"}; string s0[]={"0.","1.","2.","3.","4.","5.","6.","7.","8.","9.","10.","11.","12.","13.","14.","15.","16.","17.","18.","19."}; string s2,s3; cin>>N; sum=(long int *)malloc(N*sizeof(long int)); for(i=0;i<N;i++) { sum[i]=0; cin>>s2>>s3; cin>>year; sum[i]+=365*year; for(j=0;j<19&&s[j]!=s3;j++); sum[i]=sum[i]+20*j; for(j=0;j<20&&s2!=s0[j];j++); sum[i]=sum[i]+(j+1); cout<<sum[i]<<endl; } cout<<N<<endl; for(i=0;i<N;i++) { if(!(sum[i]%260)) { cout<<13<<' '; cout<<"ahau"<<' '; k=sum[i]/260; cout<<k-1<<endl; } else { k=sum[i]%13; cout<<k<<' '; k=sum[i]%20; cout<<s1[k-1]<<' '; k=sum[i]/260; cout<<k<<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