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 |
数据都正确~基本算法也没有问题·~大家帮帮忙看下 。到底问题在哪里~#include<stdio.h> #include<string.h> void change( int day, char *s,int year); int main() { int day,year; char *s,a[10]; int n; s=a; scanf("%d\n",&n); while(n--) { scanf("%d.%s%d",&day,a,&year); change(day ,s,year); } return 0; } void change(int day,char *s,int year) { int k=0,sum; int a,b,c; char *m[19]={"pop","no","zip","zotz","tzec", "xul","yoxkin","mol","chen","yax","zac", "ceh","mac","kankin","muan","pax","koyab","cumhu", "uayet"}; char *tm[20]={"imix","ik","akbal","kan","chicchan","cimi","manik","lamat","muluk","ok", "chuen","eb","ben","ix","mem","cib","caban","eznab","canac","ahau"}; while(strcmp(s, m[k])) k++; sum=year*365+k*20+day; a=sum%13+1; b=sum%20; c= sum/260; printf("%d %s %d\n",a,tm[b],c); } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator