Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Re:代码在这,完全按照输入输出来做,为什么老是WRONG ANSWER,求人来看看

Posted by computerartist at 2010-05-06 11:55:43 on Problem 1008
In Reply To:Re:代码在这,完全按照输入输出来做,为什么老是WRONG ANSWER,求人来看看 Posted by:computerartist at 2010-05-06 11:28:04
#include<iostream>
#include<string>
using namespace std;
int main(){
    string Haab[19]={"pop", "no", "zip", "zotz", "tzec", "xul", "yoxkin", "mol", "chen", "yax", "zac", "ceh", "mac", "kankin", "muan", "pax", "koyab", "cumhu", "uayet"};
    string Tzolkin[20]={"imix", "ik", "akbal", "kan", "chicchan", "cimi", "manik", "lamat", "muluk", "ok", "chuen", "eb", "ben", "ix", "mem", "cib", "caban", "eznab", "canac", "ahau"};
    int number,count,haabYear,haabDay,totalDays;
    string haabMonth;
    char dot;
    cin>>number;
    cout<<number<<endl;
    for(count=1;count<=number;count++){
        totalDays=0;
        cin>>haabDay>>dot>>haabMonth>>haabYear;
        for(int j=0;j<19;j++)
            if(Haab[j]==haabMonth){
                totalDays+=j*20;
                totalDays+=365*haabYear+haabDay;
                break;
            }
        cout<<(totalDays%260)%13+1<<" "<<Tzolkin[(totalDays%260)%20]<<" "<<totalDays/260<<endl;
    }
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator