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 |
我在VC 上可以正确运行,可以提交就是 runtime error,请帮忙看看吧,谢谢!#include<stdio.h> #include<string.h> char HaabMonth[19][10]={"pop","no","zip","zotz","tzec","xul","yoxkin","mol","chen","yax","zac","ceh","mac","kankin","muan","pax","koyab","cumhu","uayet"}; char HollyName[20][10]={"imix","ik","akbal","kan","chicchan","cimi","manik","lamat","muluk","ok","chuen","eb","ben","ix","mem","cib","caban","eznab","canac","ahau"}; struct output { int No; char *Name; int Year; }; int main() { int n,day,year,m,t,f; char s[10]; struct output P[50]; scanf("%d",&n); for(f=0;f<n;f++) { scanf("%d. %s %d",&day,s,&year); for(m=0;m<19;m++) if(strcmp(HaabMonth[m],s)==0) break; t=day+20*m+365*year; P[f].No=1+t%13; P[f].Name=HollyName[t%20]; P[f].Year=t/260; } printf("%d\n",n); for(f=0;f<n;f++) printf("%d %s %d\n",P[f].No,P[f].Name,P[f].Year); return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator