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

太水了无语啊!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!代码附上

Posted by wocha at 2012-06-05 16:16:44 on Problem 1008
#include<stdio.h>
#include<math.h>
#include<string.h>
char s1[22][22]={"pop","no","zip","zotz","tzec","xul","yoxkin","mol","chen","yax",
                 "zac","ceh","mac","kankin","muan","pax","koyab","cumhu"};
char s2[23][23]={"imix","ik","akbal","kan","chicchan","cimi","manik","lamat","muluk",
                 "ok","chuen","eb", "ben","ix","mem","cib","caban","eznab","canac","ahau"};
int main()
{
   int n,m,k,l,i,j,h,q,w;
   while(~scanf("%d",&m))
   {
        printf("%d\n",m);
        while(m--)
        {
            char mon[44];
            int day,year;
            scanf("%d. %s %d",&day,mon,&year);
            n=year*365;
            for(i=0;i<19;i++)
            {
                if(strcmp(mon,s1[i])==0) break;
            }         
            if(i!=19) n+=(i)*20+day; 
            if(i==19) n+=(18*20)+day;
            q=n%20;
            w=n%13;
            printf("%d",w+1);
            printf(" %s ",s2[q]);
            printf("%d\n",n/260);
         
        }
    } 
}


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