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 |
高手们啊,帮忙找找错吧~~~#include<iostream.h> bool compare(char *m,int i); char *monthN[19]={"pop","no","zip","zotz","tzec","xul","yoxkin", "mol","chen","yax","zac","ceh","mac","kankin", "muan","pax","koyab","cumhu","uayet"}; char *dayN[20]={"imix","ik","akbal","kan","chicchan","cimi", "manik","lamat","muluk","ok","chuen","eb","ben", "ix","mem","cib","caban","eznab","canac","ahau"}; void main() { int time,days,dayH,yearH,dayT,yearT,n; char month[7],a; cin >> time; for(int i=0;i < time;i++) { cin >> dayH >> a >> month >> yearH; days = yearH*365; for(int j=0;!compare(month,j);j++); days+=j*20+dayH; yearT = days / 260; days = days - yearT*260; n = days%13+1; dayT = days%20; cout << n << " " << dayN[dayT] << " " << yearT << endl; } } bool compare(char *m,int i) { if(((int)m[0]==(int)monthN[i][0]) && ((int)m[1]==(int)monthN[i][1])) return true; else return false; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator