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 |
I don't know where the mistake is,who can help me?#include <cstdlib> #include <iostream> #include <string> using namespace std; int main(int argc, char *argv[]) { string HaabMonth[20]= {"pop", "no", "zip", "zotz", "tzec", "xul", "yoxkin", "mol", "chen", "yax", "zac", "ceh", "mac", "kankin", "muan", "pax", "koyab", "cumhu","uayet",""}; string HaabDay[20]= {"0.","1.","2.","3.","4.","5.","6.","7.","8.","9.","10.","11.","12.","13.","14.","15.","16.","17.","18.","19."}; string TzolkinName[20]= {"imix","ik","akbal","kan","chicchan","cimi","manik","lamat","muluk","ok","chuen","eb","ben","ix","mem","cib","caban","eznab","canac","ahau"}; int Case; string InputDay,InputMonth,OutputName; int InputYear,Days=0,OutputYear,OutputNumber,TempDay; cin>>Case; cout<<Case<<endl; for(int i=0;i<Case;i++) { cin>>InputDay>>InputMonth>>InputYear; Days+= InputYear*365; for(int j=0;j<20;j++) { if(InputMonth==HaabMonth[j]) { Days+=j*20; } if(InputDay==HaabDay[j]) { Days+=j+1; } } if(Days%260==0) { OutputYear=Days/260-1; OutputNumber=13; OutputName=TzolkinName[19]; } else { OutputYear=Days/260; OutputNumber=Days%13; TempDay=Days%20; OutputName=TzolkinName[TempDay-1]; } cout<<OutputNumber<<" "<<OutputName<<" "<<OutputYear<<endl; Days=0; } system("PAUSE"); return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator