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> #include<string> #include<vector> #include<stdio.h> using namespace std; int main() { int n; string mon1[]={ "pop", "no", "zip", "zotz", "tzec", "xul", "yoxkin", "mol", "chen", "yax", "zac", "ceh", "mac", "kankin", "muan", "pax", "koyab", "cumhu","uayet"}; string mon2[]={"imix", "ik", "akbal", "kan", "chicchan", "cimi", "manik", "lamat", "muluk", "ok", "chuen", "eb", "ben", "ix", "mem", "cib", "caban", "eznab", "canac", "ahau"}; while(cin>>n) { cout<<n<<'\n'; int i,j; int day,year; string t; for(i=0;i<n;i++) { cin>>day; getchar(); cin>>t; cin>>year; for(j=0;j<30;j++) if(t==mon1[j]) break; day+=((j)*20+365*year); year=day/260; j=day%20; day%=13; cout<<day+1<<" "<<mon2[j]<<" "<<year<<'\n'; } } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator