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 393783046 at 2007-12-06 22:16:27 on Problem 1008
#include<stdio.h>
#include<string.h>

int main(void)
{
	int n;
	scanf("%d",&n);
	printf("%d\n",n);
	while(n>0)
	{
		int a,c,e,f,g,h;
		char b[10];
		scanf("%d. %s %d",&a,b,&c);
		if(strcmp(b,"pop")==0)
		{
			e=0;
		}
		else if(strcmp(b,"no")==0)
		{
			e=1;
		}
		else if(strcmp(b,"zip")==0)
		{
			e=2;
		}
		else if(strcmp(b,"zotz")==0)
		{
			e=3;
		}	
		else if(strcmp(b,"tzec")==0)
		{
			e=4;
		}
		else if(strcmp(b,"xul")==0)
		{
			e=5;
		}
		else if(strcmp(b,"yoxkin")==0)
		{
			e=6;
		}
		else if(strcmp(b,"mol")==0)
		{
			e=7;
		}
		else if(strcmp(b,"chen")==0)
		{
			e=8;
		}
		else if(strcmp(b,"yax")==0)
		{
			e=9;
		}	
		else if(strcmp(b,"zac")==0)
		{
			e=10;
		}
		else if(strcmp(b,"ceh")==0)
		{
			e=11;
		}
		else if(strcmp(b,"mac")==0)
		{
			e=12;
		}
		else if(strcmp(b,"kankin")==0)
		{
			e=13;
		}
		else if(strcmp(b,"muan")==0)
		{
			e=14;
		}
		else if(strcmp(b,"pax")==0)
		{
			e=15;
		}
		else if(strcmp(b,"koyab")==0)
		{
			e=16;
		}
		else if(strcmp(b,"cumhu")==0)
		{
			e=17;
		}
		else if(strcmp(b,"uayet")==0)
		{
			e=18;
		}

		if(e==18)
		{
			f=360+a+1+c*365;
		}
		else
		{
			f=e*20+a+1+c*365;
		}
		if(f%13==0)
			g=13;
		else
			g=f%13;
		h=f%20;
		if(f%260==0)
			c=f/260-1;
		else
			c=f/260;
		switch(h)
		{
		case 1:
			printf("%d imix %d\n",g,c);
			break;
		case 2:
			printf("%d ik %d\n",g,c);
			break;
		case 3:
			printf("%d akbal %d\n",g,c);
			break;
		case 4:
			printf("%d kan %d\n",g,c);
			break;
		case 5:
			printf("%d chicchan %d\n",g,c);
			break;
		case 6:
			printf("%d cimi %d\n",g,c);
			break;
		case 7:
			printf("%d manik %d\n",g,c); 
			break;
		case 8:
			printf("%d lamat %d\n",g,c);
			break;
		case 9:
			printf("%d muluk %d\n",g,c);
			break;
		case 10:
			printf("%d ok %d",g,c);
			break;
		case 11:
			printf("%d chuen %d\n",g,c);
			break;
		case 12:
			printf("%d eb %d\n",g,c);
			break;
		case 13:
			printf("%d ben %d\n",g,c);
			break;
		case 14:
			printf("%d ix %d\n",g,c);
			break;
		case 15:
			printf("%d mem %d\n",g,c);
			break;
		case 16:
			printf("%d cib %d\n",g,c);
			break;
		case 17:
			printf("%d caban %d\n",g,c);
			break;
		case 18:
			printf("%d eznab %d\n",g,c);
			break;
		case 19:
			printf("%d canac %d\n",g,c);
			break;
		case 0:
			printf("%d ahau %d\n",g,c);
			break;
		}
		n--;
	}
	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