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 |
RE咯~!好心大虾帮忙看一下代码~!谢谢~#include<stdio.h> #include<string.h> int main(void) { int n,i,num[50],m[50],year[50],j; int day[50]; char s[9]; char month[][9]={"pop","no","zip","zotz","tzec","xul","yoxkin","mol","chen","yax","zac","ceh","mac","kankin","muan","pax","koyab","cumhu"}; char h[][9]={"imix","ik","akbal","kan","chicchan","cimi","manik","lamat","muluk","ok","chuen","eb","ben","ix","mem","cib","caban","eznab","canac","ahau"}; scanf("%d",&n); for(i=0;i<n;i++) {scanf("%d. %s %d",&num[i],&s,&year[i]); for(j=0;j<19;j++) {if(strcmp(s,month[j])==0) break; } day[i]=num[i]+j*20+year[i]*365; num[i]=day[i]%13+1; m[i]=day[i]%20; year[i]=day[i]/260; } printf("%d\n",n); for(i=0;i<n;i++) { printf("%d %s %d\n",num[i],h[m[i]],year[i]); } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator