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 |
跟SAMPLE完全一样,怎么就是WRONG ANSWER啊??!#include <stdio.h> char monhaab[7]; int monthhaab; int dayhaab,yearhaab; int numtzol[500],yeartzol[500],daytzol[500]; int i,n; void dayname() { switch(daytzol[i]) { case 1: printf("%d imix %d\n",numtzol[i],yeartzol[i]); break; case 2: printf("%d ik %d\n",numtzol[i],yeartzol[i]); break; case 3: printf("%d akbal %d\n",numtzol[i],yeartzol[i]); break; case 4: printf("%d kan %d\n",numtzol[i],yeartzol[i]); break; case 5: printf("%d chicchan %d\n",numtzol[i],yeartzol[i]); break; case 6: printf("%d cimi %d\n",numtzol[i],yeartzol[i]); break; case 7: printf("%d manik %d\n",numtzol[i],yeartzol[i]); break; case 8: printf("%d lamat %d\n",numtzol[i],yeartzol[i]); break; case 9: printf("%d muluk %d\n",numtzol[i],yeartzol[i]); break; case 10: printf("%d ok %d\n",numtzol[i],yeartzol[i]); break; case 11: printf("%d chuen %d\n",numtzol[i],yeartzol[i]); break; case 12: printf("%d eb %d\n",numtzol[i],yeartzol[i]); break; case 13: printf("%d ben %d\n",numtzol[i],yeartzol[i]); break; case 14: printf("%d ix %d\n",numtzol[i],yeartzol[i]); break; case 15: printf("%d mem %d\n",numtzol[i],yeartzol[i]); break; case 16: printf("%d cib %d\n",numtzol[i],yeartzol[i]); break; case 17: printf("%d caban %d\n",numtzol[i],yeartzol[i]); break; case 18: printf("%d eznab %d\n",numtzol[i],yeartzol[i]); break; case 19: printf("%d canac %d\n",numtzol[i],yeartzol[i]); break; default: printf("%d ahau %d\n",numtzol[i],yeartzol[i]); break; } } int month() { if(monhaab[0]=='p'&&monhaab[1]=='o') monthhaab=1; if(monhaab[0]=='n') monthhaab=2; if(monhaab[0]=='z'&&monhaab[1]=='i') monthhaab=3; if(monhaab[0]=='z'&&monhaab[1]=='o') monthhaab=4; if(monhaab[0]=='t') monthhaab=5; if(monhaab[0]=='x') monthhaab=6; if(monhaab[0]=='y'&&monhaab[1]=='o') monthhaab=7; if(monhaab[0]=='m'&&monhaab[1]=='o') monthhaab=8; if(monhaab[0]=='c'&&monhaab[1]=='h') monthhaab=9; if(monhaab[0]=='y'&&monhaab[1]=='a') monthhaab=10; if(monhaab[0]=='z'&&monhaab[1]=='a') monthhaab=11; if(monhaab[0]=='c'&&monhaab[1]=='e') monthhaab=12; if(monhaab[0]=='m'&&monhaab[1]=='a') monthhaab=13; if(monhaab[0]=='k'&&monhaab[1]=='a') monthhaab=14; if(monhaab[0]=='m'&&monhaab[1]=='u') monthhaab=15; if(monhaab[0]=='p'&&monhaab[1]=='a') monthhaab=16; if(monhaab[0]=='k'&&monhaab[1]=='o') monthhaab=17; if(monhaab[0]=='c'&&monhaab[1]=='u') monthhaab=18; if(monhaab[0]=='u') monthhaab=19; return monthhaab; } void main() { int dtb,daystzol; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%d. %s %d",&dayhaab,monhaab,&yearhaab); month(); dtb=365*yearhaab+20*(monthhaab+1)+dayhaab+1; yeartzol[i]=dtb/260; daystzol=dtb-yeartzol[i]*260; numtzol[i]=daystzol%13-1; daytzol[i]=daystzol%20; } printf("%d\n",n); for(i=0;i<n;i++) dayname(); } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator