Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
为什么在机上测试通过,但是上传说wrong answer??麻烦帮忙找一下原因。。#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator