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

狂顶!!竟然忘了把19月的字符串加进去,好开森,贴AC代码!

Posted by 10112040 at 2013-07-30 20:29:09 on Problem 1008
In Reply To:注意这组数据 Posted by:bergkamp at 2006-08-04 20:38:33
#include<iostream>
#include<cstdlib>
#include<cstring>
#include<cstdio>
using namespace std;

int main()
{
    //freopen("in.txt","r",stdin);
    char h[20][10]={"","pop","no","zip","zotz","tzec","xul","yoxkin","mol","chen","yax","zac","ceh","mac","kankin","muan","pax","koyab","cumhu","uayet"};
    char t[21][10]={"","imix","ik","akbal","kan","chicchan","cimi","manik","lamat","muluk","ok","chuen","eb","ben","ix","mem","cib","caban","eznab","canac","ahau"};
    int time;
    cin>>time;
    cout<<time<<endl;
    int sum,hy,hd,ty,tm,td;
    char dot[10],str[10];
    while(time--)
    {
        sum=0;
        cin>>hd>>dot>>str>>hy;
        sum+=hd;
        int i;
        for(i=1;i<=20;i++)
        {
            if(strcmp(str,h[i])==0)
            break;
        }
        sum+=(i-1)*20;
        sum+=hy*365;
        td=sum%13+1;
        tm=sum%20+1;
        ty=sum/260;
        cout<<td<<" "<<t[tm]<<" "<<ty<<endl;
    }
    return 0;
}

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