| ||||||||||
| 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>
using namespace std;
char *Haab[] = {"pop", "no", "zip", "zotz", "tzec", "xul", "yoxkin", "mol", "chen", "yax", "zac", "ceh", "mac", "kankin", "muan", "pax", "koyab", "cumhu", "uayet"},
*Tzolkin[] = {"ahau", "imix", "ik", "akbal", "kan", "chicchan", "cimi", "manik", "lamat", "muluk", "ok", "chuen", "eb", "ben", "ix", "mem", "cib", "caban", "eznab", "canac"};
void main()
{
long int tot, i, j;
cin >> tot;
cout << tot << endl;
for (i = 0; i < tot; i ++)
{
long int day, year, mon, totdays, Tday, Tnum, Tyear;
char str[10];
cin >> day >> str[0];
cin.getline(str, 2, ' ');
cin.getline(str, 5, ' ');
for (j = 0; j < 20; j ++)
if (Haab[j][0] == str[0] && Haab[j][1] == str[1]) break;
mon = j;
cin >> year;
totdays = year * 365 + mon * 20 + day + 1;
Tyear = (totdays - 1) / 260;
Tday = totdays - Tyear * 260;
if (Tday == 0) Tday = 260;
Tnum = Tday % 13;
if (Tnum == 0) Tnum = 13;
Tday = Tday % 20;
cout << Tnum << ' ' << Tzolkin[Tday] << ' ' << Tyear << endl;
}
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator