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

终于AC啦!发个贴庆祝一下

Posted by lihanwuhan at 2005-09-29 16:13:48 on Problem 1008
#include<stdio.h>
#include<string.h>

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[22][10]={"ahau","imix","ik","akbal","kan","chicchan","cimi","manik","lamat",
              "muluk","ok","chuen","eb","ben","ix","mem","cib","caban","eznab","canac"};
char strh[50];

int main()
{
    //freopen("in.txt","r",stdin);
    int day,year,n,i;
    char month[20];
    scanf("%d",&n);
    getchar();
    printf("%d\n",n);
    while(n--)
    {
        gets(strh);
        sscanf(strh,"%d. %s %d",&day,month,&year);
        for(i=0;i<18;i++)
            if(strcmp(month,H[i])==0) break;
        day+=i*20+year*365;
        printf("%d %s %d\n",day%13+1,T[(day+1)%20],day/260);
    }
    //while(1);
    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