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 wic at 2008-04-04 20:28:51 on Problem 1008
#include<iostream>
#include<cstring>
using namespace std;
int main()
{
	int n;
	char h[19][10]={"pop", "no", "zip", "zotz", "tzec", "xul", "yoxkin", "mol", "chen", "yax", "zac", "ceh", "mac", "kankin","muan", "pax", "koyab", "cumhu","uayet"};
	char t[20][10]={"imix", "ik", "akbal", "kan", "chicchan", "cimi", "manik", "lamat", "muluk", "ok", "chuen", "eb", "ben", "ix", "mem", "cib", "caban", "eznab", "canac", "ahau"};
	
	
	int hd,hy,td,ty;
	char hm[10],tm[10];
	int i,j,a,d;
	char c;
	
	cin>>n;
	for(j=0;j<n;j++)
	{
		scanf("%d%*s %s %d",&hd,hm,&hy);
		for(i=0;i<19;i++)
		{
			if(strlen(hm)==strlen(h[i]))
			{
                            if(strcmp(hm,h[i])==0)break;
                      
			}

		}
	
		d=hy*365+i*20+hd+1;
	
	    if(d%13==0)
		td=13;
		else
		td=d%13;
		if(d%260==0)
		ty=d/260-1;
		else
		ty=d/260;
		if(d%20==0)
		a=20;
		else 
		a=d%20;
		strcpy(tm,t[a-1]);
		
		cout<<td<<" ";
		printf("%s ",tm);
		cout<<ty<<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