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 |
请大牛帮忙看下啊,runtime,好郁闷啊,或说一下做题思想 感谢啊#include<iostream> #include<string> using namespace std; int main() { int n; cin>>n; int i=0; int day1=0,year1=0; char a[10]; char ch; char flag1[20][10]={"pop","no","zip","zotz","tzec","xul","yoxkin","mol","chen","yax", "zac","ceh","mac","kankin","muan","pax","koyab","cumhu","uayet"}; char flag2[20][10]={"imix","ik","akbal","kan","chicchan","cimi","manik","lamat","muluk", "ok","chuen","eb","ben","ix","mem","cib","caban","eznab","canac","ahau"}; int month; int num[20],year2[20]={0}; int str[20]; for(i=0;i<n;i++) { cin>>day1>>ch>>a>>year1; for(int j=0;j<20;j++) { if(strcmp(flag1[j],a)==0) { month=j; break; } } str[i]=(day1+year1*5)%20; long sum=105*year1+month*20+day1; num[i]=(year1+month*20+day1)%13+1; year2[i]=year1+sum/260; } cout<<n<<endl; for(i=0;i<n;i++) cout<<num[i]<<" "<<flag2[ str[i] ]<<" "<<year2[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