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 phonexi at 2005-06-06 11:26:38 on Problem 1008
#include<string.h>
#include<stdio.h>
#include<stdlib.h>

char Tzolkin[20][10]={"imix","ik","akbal","kan","chicchan","cimi","manik","lamat","muluk","ok","chuen","eb","ben","ix","mem","cib","caban","eznab","canac","ahau"};
char Haab[19][10]={"pop", "no", "zip", "zotz","tzec", "xul", "yoxkin", "mol", "chen", "yax", "zac", "ceh", "mac", "kankin", "muan", "pax", "koyab", "cumhu"};

void main()
{
int year,day,monthway;
char month[10];
char c;
int number;
int i,j,num;
unsigned long totle,YEAR;

scanf("%d",&number);
printf("%d",number);
for(i=0;i<number;i++)
{
    scanf("%d%c %s %d",&day,&c,&month,&year);
    for(j=0;j<19;j++)
    {
       if(strcmp(month,Haab[j])==0)
       {
            monthway=j;
       }
    }

    totle=365*(long)year+20*(long)monthway+(long)day;
    num=(totle%260)%20;
    YEAR=totle/260;
    printf("%ld ",((totle%260)%13)+1);
    printf("%s ",Tzolkin[num]);
    printf("%ld",YEAR);

}

}

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