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 |
各种数据都过了,还wa!受不了了!救救我吧……#include<iostream.h> #include<stdio.h> #include<stdlib.h> char haab[19][3]={"po", "no", "zi", "zo", "tz", "xu", "yo", "mo", "ch", "ya", "za", "ce", "ma", "ka", "mu", "pa", "ko", "cu","ua"}; char tzolkin[20][9]={"imix", "ik", "akbal", "kan", "chicchan", "cimi", "manik", "lamat", "muluk", "ok", "chuen", "eb", "ben", "ix", "mem", "cib", "caban", "eznab", "canac", "ahau"}; int main() { int n,t,tal,year,mon,day,i,j; char month[6]; cin>>n; int *b=new int[n]; int *a=new int[n]; int *c=new int[n]; for(j=0;j<n;j++) { scanf("%d.%s %d",&day,month,&year); for(i=0;i<19;i++) if((month[0]==haab[i][0])&&(month[1]==haab[i][1])) {t=i;break;} tal=year*365+t*20+day; a[j]=tal/260; b[j]=tal%20; c[j]=tal%13; } for(j=0;j<n;j++) { printf("%d %s %d\n",c[j]+1,tzolkin[b[j]],a[j]); } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator