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

为什么是wrong answer?

Posted by X at 2004-04-04 22:00:33 on Problem 1008
#include <iostream>
#include <string>

using namespace std;

void 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]={"ahau","imix","ik","akbal","kan","chicchan","cimi","manik","lamat",
                      "muluk","ok","chuen","eb","ben","ix","mem","cib","caban","eznab","canac"}; 
  float dayh;
  string monthh;
  int yearh;
  int mh=0;
  int tl=0;
  int td=0;
  int tm=0;
  long days=0;
  int loop=0;
  cin>>loop;
  for (int lp=1;lp<=loop;lp++)
  {
  cin>>dayh>>monthh>>yearh;
  for (int i=0;i<19;i++)
  {
    if (monthh==Haab[i])
    {
        mh=i;
        break;
    }
  }
  days=365*yearh+20*mh+int(dayh)+1;
  
  tl=days%260;
  
  td=tl%13;
  tm=tl%20;
  
  if (td==0) td=13;
  if (lp==1) cout<<loop<<endl;
 cout<<td<<' '<<Tzolkin[tm]<<' '<<days/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