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

一直wr求大神帮忙看看 救救孩子吧

Posted by maxven at 2019-05-08 20:58:18 on Problem 1008
#include<iostream>
#include<cstring>
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<string>
#include<map>
using namespace std;
map<string,int> mp;
map<int,string> mmp;
int main()
{
	/*

	4
	10. zac 0
	0. pop 0
	10. zac 1995
	4. uayet 259
	
4
3 chuen 0
1 imix 0
9 cimi 2801
13 ahau 364
	*/
	mp["pop"]=0,mp["no"]=1,mp["zip"]=2,mp["zotz"]=3;
	mp["tzec"]=4,mp["xul"]=5,mp["yoxkin"]=6,mp["mol"]=7;
	mp["chen"]=8,mp["yax"]=9,mp["zac"]=10,mp["ceh"]=11;
	mp["mac"]=12,mp["kankin"]=13,mp["muan"]=14,mp["pax"]=15;
	mp["koyab"]=16,mp["cumhu"]=17,mp["uayet"]=18;

	mmp[1]="imix",mmp[2]="ik",mmp[3]="akbal",mmp[4]="kan";
	mmp[4]="chicchan",mmp[6]="cimi",mmp[7]="manik",mmp[8]="lamat";
	mmp[9]="muluk",mmp[10]="ok",mmp[11]="chuen",mmp[12]="eb";
	mmp[13]="ben",mmp[14]="ix",mmp[15]="mem",mmp[16]="cib";
	mmp[17]="caban",mmp[18]="eznab",mmp[19]="canac",mmp[20]="ahau";
	int time,n;
	cin>>n;
	cout<<n<<endl;
	while(n--)
	{
		string month;
		int d,y,time;
		scanf("%d.",&d);
		cin>>month>>y;
		time=d+mp[month]*20+y*365;
		y=time/260;
		month=mmp[time%20+1];
		d=time%13+1;
		cout<<d<<" "<<month<<" "<<y<<endl;
	}
	return 0;
}

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