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

那位仁兄帮帮忙啊,狂查5小时还是WA

Posted by through at 2006-03-07 13:31:07 on Problem 1008
#include <iostream.h>
#include <stdio.h>
#include <string.h>
char m1[19][9]={"pop", "no", "zip", "zotz", "tzec", "xul", "yoxkin",
"mol","chen", "yax", "zac", "ceh", "mac", "kankin", "muan", "pax", "koyab", "cumhu","uayet"};
char m2[20][9]={ "imix", "ik", "akbal", "kan", "chicchan", "cimi", "manik",
"lamat", "muluk", "ok", "chuen", "eb", "ben", "ix", "mem", "cib", "caban", "eznab", "canac", "ahau"}; 

void main()
{
	int n;
	cin>>n;
	cout<<n<<endl;
	for(int y=0;y<n;y++)
	{
		long int day1,year1,sum,i;
	    char month1[7];
	    scanf("%d. %s %d",&day1,month1,&year1);
	    for(i=0;i<19;i++)
		{
		if(strcmp(m1[i],month1)==0)
			break;
		}
		
    	sum=year1*365+i*20+day1;
        printf("%d %s %d\n",1+sum%13,m2[sum%20],sum/260);
	    
		
     	
	}
	
}

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