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 806601756 at 2011-07-06 10:38:10 on Problem 1008
哪位大哥帮忙看看,注意的数据都过了,怎么还是WA啊?

#include<stdio.h>
#include<string.h>
void main()
{
	int n,i,j=0,k;
	int day[10000],month[10000],year[10000];
	int d[10000],m[10000],y[10000];
	char s[10000][10],t[10000][10];
	scanf("%d",&n);
	for(i=0;i<n;i++,j++)
		scanf("%d. %s%d",&day[j],s[j],&year[j]);
	for(i=0;i<n;i++)
	{
		day[i]++;
		if((strcmp(s[i],"pop"))==0)month[i]=1;
		else if((strcmp(s[i],"no"))==0)month[i]=2;
		else if((strcmp(s[i],"zip"))==0)month[i]=3;
		else if((strcmp(s[i],"zotz"))==0)month[i]=4;
		else if((strcmp(s[i],"tzec"))==0)month[i]=5;
		else if((strcmp(s[i],"xul"))==0)month[i]=6;
		else if((strcmp(s[i],"yoxkin"))==0)month[i]=7;
		else if((strcmp(s[i],"mol"))==0)month[i]=8;
		else if((strcmp(s[i],"chen"))==0)month[i]=9;
		else if((strcmp(s[i],"yax"))==0)month[i]=10;
		else if((strcmp(s[i],"zac"))==0)month[i]=11;
		else if((strcmp(s[i],"ceh"))==0)month[i]=12;
		else if((strcmp(s[i],"mac"))==0)month[i]=13;
		else if((strcmp(s[i],"kankin"))==0)month[i]=14;
		else if((strcmp(s[i],"muan"))==0)month[i]=15;
		else if((strcmp(s[i],"pax"))==0)month[i]=16;
		else if((strcmp(s[i],"koyab"))==0)month[i]=17;
		else if((strcmp(s[i],"cumhu"))==0)month[i]=18;
		else if((strcmp(s[i],"uayet"))==0)month[i]=19;
		day[i]=day[i]+year[i]*365+(month[i]-1)*20;
		d[i]=day[i]%13;
		if(d[i]==0)d[i]=13;
		if((year[i]*365.0/260.0)==(int)(year[i]*365/260))y[i]=(int)(year[i]*365/260);
		else y[i]=(int)(year[i]*365/260)+1;
		m[i]=day[i]%20;
		if(m[i]==1)strcpy(t[i],"imix");
		else if(m[i]==2)strcpy(t[i],"ik");
		else if(m[i]==3)strcpy(t[i],"akbal");
		else if(m[i]==4)strcpy(t[i],"kan");
		else if(m[i]==5)strcpy(t[i],"chicchan");
		else if(m[i]==6)strcpy(t[i],"cimi");
		else if(m[i]==7)strcpy(t[i],"manik");
		else if(m[i]==8)strcpy(t[i],"lamat");
		else if(m[i]==9)strcpy(t[i],"muluk");
		else if(m[i]==10)strcpy(t[i],"ok");
		else if(m[i]==11)strcpy(t[i],"chuen");
		else if(m[i]==12)strcpy(t[i],"eb");
		else if(m[i]==13)strcpy(t[i],"ben");
		else if(m[i]==14)strcpy(t[i],"ix");
		else if(m[i]==15)strcpy(t[i],"mem");
		else if(m[i]==16)strcpy(t[i],"cib");
		else if(m[i]==17)strcpy(t[i],"caban");
		else if(m[i]==18)strcpy(t[i],"eznab");
		else if(m[i]==19)strcpy(t[i],"canac");
		else if(m[i]==0)strcpy(t[i],"ahau");
	}
	printf("%d\n",n);
	for(i=0;i<n;i++)
		printf("%d %s %d\n",d[i],t[i],y[i]);
}

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