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

Re:为什么我得到的老是Wrong Answer,哪位大神帮我看看吧,非常感谢啊

Posted by 131025198805240014 at 2011-11-04 11:13:19 on Problem 1008
In Reply To:为什么我得到的老是Wrong Answer,哪位大神帮我看看吧,非常感谢啊 Posted by:894788609 at 2011-11-03 16:44:24
> #include<stdio.h>
> int main()
> {
> 	int day[5000],year[5000],data[5000],month0[5000]={18},i,n;
> 	char month[5000][5],a;
> 	scanf("%d",&n);
> 	for(i=0;i<n;i++)
> 		month0[i]=18;
> 	for(i=0;i<n;i++)
> 	{
> 		scanf("%d%c%s%d",&day[i],&a,month[i],&year[i]);
> 	}
> 	printf("%d\n",n);
> 	for(i=0;i<n;i++)
> 	{
> 		switch(month[i][0])
> 		{
> 		case 'c':
> 			switch(month[i][1])
> 			{
> 			case 'h':month0[i]=8;break;
> 			case 'e':month0[i]=11;break;
> 			case 'u':month0[i]=17;break;
> 			}
> 			break;
> 		case 'm':
> 			switch(month[i][1])
> 			{
> 			case 'o':month0[i]=7;break;
> 			case 'u':month0[i]=14;break;
> 			case 'a':month0[i]=12;break;
> 			}
> 			break;
> 		case 'z':
> 			switch(month[i][1])
> 			{
> 			case 'i':month0[i]=2;break;
> 			case 'o':month0[i]=3;break;
> 			case 'a':month0[i]=10;break;
> 			}
> 			break;
> 		case 'y':
> 			switch(month[i][1])
> 			{
> 			case 'o':month0[i]=6;break;
> 			case 'a':month0[i]=9;break;
> 			}
> 			break;
> 		case 'p':
> 			switch(month[i][1])
> 			{
> 			case 'o':month0[i]=0;break;
> 			case 'a':month0[i]=15;break;
> 			}
> 			break;
> 		case 'k':
> 			switch(month[i][1])
> 			{
> 			case 'o':month0[i]=16;break;
> 			case 'a':month0[i]=13;break;
> 			}
> 		case 'n':month0[i]=1;break;
> 		case 't':month0[i]=4;break;
> 		case 'x':month0[i]=5;break;
> 		}
> 		data[i]=year[i]*365+month0[i]*20+day[i]+1;
> 		year[i]=(data[i]-1)/260;
> 		data[i]=(data[i]-1)%260+1;
> 		day[i]=(data[i]-1)%20+1;
> 		switch(day[i])
> 		{
> 		case 1:printf("%d imix %d\n",((data[i]-1)%13+1),year[i]);break;
> 		case 2:printf("%d ik %d\n",((data[i]-1)%13+1),year[i]);break;
> 		case 3:printf("%d akbal %d\n",((data[i]-1)%13+1),year[i]);break;
> 		case 4:printf("%d kan %d\n",((data[i]-1)%13+1),year[i]);break;
> 		case 5:printf("%d chicchan %d\n",((data[i]-1)%13+1),year[i]);break;
> 		case 6:printf("%d cimi %d\n",((data[i]-1)%13+1),year[i]);break;
> 		case 7:printf("%d manik %d\n",((data[i]-1)%13+1),year[i]);break;
> 		case 8:printf("%d lamat %d\n",((data[i]-1)%13+1),year[i]);break;
> 		case 9:printf("%d muluk %d\n",((data[i]-1)%13+1),year[i]);break;
> 		case 10:printf("%d ok %d\n",((data[i]-1)%13+1),year[i]);break;
> 		case 11:printf("%d chuen %d\n",((data[i]-1)%13+1),year[i]);break;
> 		case 12:printf("%d eb %d\n",((data[i]-1)%13+1),year[i]);break;
> 		case 13:printf("%d ben %d\n",((data[i]-1)%13+1),year[i]);break;
> 		case 14:printf("%d ix %d\n",((data[i]-1)%13+1),year[i]);break;
> 		case 15:printf("%d mem %d\n",((data[i]-1)%13+1),year[i]);break;
> 		case 16:printf("%d cib %d\n",((data[i]-1)%13+1),year[i]);break;
> 		case 17:printf("%d caban %d\n",((data[i]-1)%13+1),year[i]);break;
> 		case 18:printf("%d eznab %d\n",((data[i]-1)%13+1),year[i]);break;
> 		case 19:printf("%d canac %d\n",((data[i]-1)%13+1),year[i]);break;
> 		case 20:printf("%d ahau %d\n",((data[i]-1)%13+1),year[i]);break;
> 		}
> 	}
> 	return 1;
> }

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