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:水题1008为什么一直过不了????请大牛指导T_T

Posted by guangongmobaizhe at 2013-12-26 10:12:30
In Reply To:水题1008为什么一直过不了???? Posted by:guangongmobaizhe at 2013-12-26 10:10:04
#include<stdio.h>
#include<string.h>
int main()
{
	char haabmou[19][10]={ "pop", "no", "zip", "zotz", "tzec", "xul",
		"yoxkin", "mol", "chen", "yax", "zac", "ceh", "mac", "kankin", "muan",
		"pax", "koyab", "cumhu","uayet"};
	char tzolkim[21][10]={"imix", "ik", "akbal", "kan", "chicchan", "cimi",
		"manik", "lamat", "muluk", "ok", "chuen", "eb", "ben", "ix", "mem", 
		"cib", "caban", "eznab", "canac","ahau"};
	int n,day,year,i,totalday;
	int num,egchar,tyear,tempt;
	char ch;
	scanf("%d",&n);
	while(n--)
	{
		char temp[10]={""};
		scanf("%d.%s %d",&day,temp,&year);
		for(i=0;i<19;i++)
		{
			if(strcmp(haabmou[i],temp)==0)
			{
				totalday=year*365+day+i*20;
				break;
			}
		}
		tyear=totalday/260;
		num=totalday%13+1;
		egchar=totalday%20;
		printf("%d %s %d\n",num,tzolkim[egchar],tyear);

	}
	return 0;
}

这是我修改了n次的代码,但是想了好久,还是觉得找不到什么问题,但是就是一直过不了。找了别人过的代码看,跟我的没有什么差别,但是别人的过了,我却一直没有过。感觉好奇怪啊,请大牛们指导

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