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 shinnseed at 2013-04-19 15:19:54 on Problem 1008
#include"stdio.h"
#include"string.h"
#include"ctype.h"

int main(){
	char  Haab[19][15] ={"pop", "no", "zip", "zotz", "tzec", "xul", "yoxkin", "mol", "chen", "yax", "zac", "ceh", "mac", "kankin", "muan", "pax", "koyab", "cumhu","uayet"} ;
	char Tzolkin[20][15] = { "imix", "ik", "akbal", "kan", "chicchan", "cimi", "manik", "lamat", "muluk", "ok", "chuen", "eb", "ben", "ix", "mem", "cib", "caban", "eznab", "canac", "ahau"} ;
	long d,y,mm,t;
	float f ;
	int n,i,j;
	char m[15] = "",ch;
	scanf("%d",&n) ;
	getchar() ;
	for(i=0;i<n;i++){
		strcpy(m,"") ;
		d = 0 ;
		y = 0 ;
		int flag = 1 ;
		int k = 0 ;
		while((ch=getchar())!='\n'){
			if(isdigit(ch)){
				if(flag==1)
					d = d*10 + (ch-'0') ;
				else
					y = y*10 + (ch-'0') ;
			}
			else
			if(isalpha(ch)){
				flag=0 ;
				m[k++] = ch ;
			}
			
		}
		for(j=0;j<19;j++)
			if(strcmp(Haab[j],m)==0) break ;
		d+=j*20 + y*105 ;
		y+=d/260 ;
		d%=260 ;
		mm = d%13+1 ;
		d = d%20;
		printf("%ld %s %ld\n",mm,Tzolkin[d],y)  ;
	}
	
	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