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

这里的各种特殊数据都通过了啊,为什么还是WA,好郁闷啊,不知道哪里错了,求大神指点

Posted by lxp_rs at 2012-06-19 18:58:05 on Problem 1008
#include <stdio.h>
#include <string.h>


int N,d,y,total;
char m[100]; 
char haab[19][10]={"pop","no","zip","zotz","zec","xul","yoxkin","mol","chen","yax","zac","ceh","mac","kankin","muan","pax","koyab","cumhu","uayet"};
char tzolkin[20][10]={"imix","ik","akbal","kan","chicchan","cimi","manik","lamat","muluk","ok","chuen","eb","ben","ix","mem","cib","caban","eznab","canac","ahau"};

int main()
{
    int i;  
    scanf("%d",&N);
    printf("%d\n",N);
    while(N--){
        scanf("%d.%s%d",&d,m,&y);
        total = 0;
        for(i=0; i<19; i++){
            if(strcmp(haab[i],m)==0){
                total = d + i*20 + y*365;
                break;  
            }       
        }       
        printf("%d %s %d\n",total%13+1,tzolkin[total%20],total/260);
    }
    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