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 <iostream> #include <string> using namespace std; const int N=700; int main(){ int n; //输入个数 int m,i; int d[N],f[N]; char e[N][9]; int s; //日数 int a,c; //日 年 char b[9]; //月 char h[19][9]={ "pop","no","zip","zotz","tzec","xul","yoxkin","mol","chen","yax", "zac","ceh","mac","kankin","muan","pax","koyab","cumhu","uayet" }; char t[20][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",&a,&b,&c); for(m=0;m<19;m++) if(strcmp(b,h[m])==0) break; s=a+m*20+c*365; if(s==0){ d[i]=1; strcpy(e[i],t[0]); f[i]=0; } else{ d[i]=s%13+1; strcpy(e[i],t[s%20]); f[i]=s/260; } } printf("%d\n",n); for(i=0;i<n;i++){ printf("%d %s %d\n",d[i],e[i],f[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