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

一开始定义day[20][6]了,居然直接提交了、

Posted by D_e_n_g at 2012-08-06 16:22:04 on Problem 1008
#include<stdio.h>
#include<string.h>

int main()
{
    int i,j,m,n,a,x;
    char mon[19][7]={"pop","no","zip","zotz","tzec","xul","yoxkin","mol","chen","yax","zac","ceh","mac","kankin","muan","pax","koyab","cumhu","uayet"};
    char day[20][9]={"imix","ik","akbal","kan","chicchan","cimi","manik","lamat","muluk","ok","chuen","eb","ben","ix","mem","cib","caban","eznab","canac","ahau"};
    char ch[7];
    scanf("%d",&j);
    printf("%d\n",j);
    for(i=0;i<j;i++)
    {
        scanf("%d.%s %d",&n,ch,&m);
        for(a=0;strcmp(mon[a],ch);a++);
        x=20*a+n+m*365;
        printf("%d %s %d\n",(x%13)+1,day[x%20],x/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