| ||||||||||
| 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 | |||||||||
检查了好长时间,实在看不出来哪里错了,哪位大虾能帮我看看吗?#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
int n;
int i, j;
int day, month, year;
int nth;
char szMonth[16];
int out;
char *inName[] = {"pop", "no", "zip", "zotz", "tzec", "xul",
"yoxkin", "mol", "chen", "yax", "zac", "ceh",
"mac", "kankin", "muan", "pax", "koyab", "cumhu", "uayet"};
char *outName[] = {"imix", "ik", "akbal", "kan", "chicchan",
"cimi", "manik", "lamat", "muluk", "ok",
"chuen", "eb", "ben", "ix", "mem",
"cib", "caban", "eznab", "canac", "ahau"};
cin >> n;
for (i = 0; i < n; i++)
{
cin >> day;
cin.get();
cin >> szMonth >> year;
for (j = 0; j < 19 ; j++)
if (strcmp(szMonth, inName[j]) == 0)
break;
nth = day + 20 * j + 365 * year;
day = nth % 13 + 1;
out = nth % 20;
year = nth / 260;
cout << day << " " << outName[out] << " " << year << endl;
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator