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 |
Re:测试数据也过了 但是总是不能通过In Reply To:测试数据也过了 但是总是不能通过 Posted by:davidmeng6628 at 2006-03-22 11:22:50 year2的计算有错 我把程序改为: #include <iostream.h> #include <string.h> #include <stdio.h> int main() { char month1[19][9]={"pop", "no","zip","zotz","tzec","xul","yoxkin","mol","chen","yax","zac", "ceh","mac","kankin","muan","pax","koyab","cumhu","uayet" }; char month2[20][10] ={ "ahau ","imix ", "ik ", "akbal ", "kan ", "chicchan ", "cimi ", "manik ", "lamat ", "muluk ", "ok ", "chuen ","eb ", "ben ", "ix ", "mem ", "cib ", "caban ", "eznab ", "canac "}; int year1,day1,year2,day2,count,day; char t,word[10]; cin>>count; cout<<count<<endl; while(count--) { cin>>day1; cin>>t; cin>>word; int i=0; for (i=0;strcmp(word,month1[i]);i++); int m=i; cin>>year1; if (m==19) day=360+day1; else day=m*20+day1; year2=(365*year1+day)/260; day+=year1%260*365; day++; int mon=day%20; day2=day%13; if (day2==0) day2=13; cout<<day2<<" "<<month2[mon]<<year2<<endl; } return 0; } 就ac了 Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator