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

有没有大佬帮我看看哇?哭惹!测试全过,一交就wa

Posted by 2017171222 at 2019-06-12 19:21:32 on Problem 1008
#include<iostream>
#include<algorithm>
#include<string.h> 
using namespace std; 
//Tzolkin周期为260天 
struct Tzolkinday{
	int day;
	char str[10];
}Td[261];
struct Haabday{
	char str[10];
	int index;
}Hd[20];
int main()  
{  
	char ss[20][20]={"imix","ik","akbal","kanan","chicchan","cimi","manik"
	,"lamat","muluk","ok","chuen","eb","ben","ix","mem","cib","caban","eznab","canac","ahau"};
	char sss[21][21]={"pop","no","zip","zotz","tzec","xul","yoxkin","mol"
	,"chen","yax","zac","ceh","mac","kankin","muan","pax","koyab","cuhu","uayet"};
	for(int i=1;i < 20;i++)
		{
			strcpy(Hd[i].str,sss[i-1]);
			Hd[i].index=Hd[i].str[0]+Hd[i].str[1];
		}
	int n;
	int day;
	char month[10];
	int year;
	cin >> n;
	while(n--)
	{
		char temp[15];
		char lost[2];
		int sumday=0;
		cin >> day >> lost;
		cin >> month >> year;
		int locate;
		int tempindex=month[0]+month[1];
		for(int i=1;i < 20;i++)//找到这个月是第几个月
		if(tempindex==Hd[i].index) 
		{
			locate = i;
			break;
		}
		
		sumday=year*365+day+(locate-1)*20;
		int Tyear=sumday/260;//年 
		int xth=sumday%260+1;//日
		cout << (xth-1)%13+1 << ' '  << ss[(xth-1)%20] << ' ' << Tyear << 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