Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

帮帮我。。。实在找不出错

Posted by 00448246 at 2005-03-04 18:27:27 on Problem 1008
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator