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啊,请高手指点,不胜感激!!!!!!!!!!1

Posted by 90305103 at 2003-12-08 18:50:44 on Problem 1008
#include <iostream.h>
#include <string.h>

int fhaab(int year, int month, int day){
	int tt=999;
	tt=365*year+(month-1)*20+day+1;
	return(tt);
}

void main(){
	const char haabs[18][8]={"pop", "no", "zip", "zotz", "tzec", "xul", "yoxkin",
						"mol", "chen", "yax", "zac", "ceh", "mac", "kankin", 
						"muan", "pax", "koyab", "cumhu"};
	const char hollys[20][9]={"imix","ik","akbal","kan","chicchan","cimi",
							"manik","lamat","muluk","ok","chuen","eb","ben",
							"ix","mem","cib","caban","eznab","canac","ahau"};
	int i,j,i1,n,haabd,haabm,haaby;
	int holly1,holly2;
	int	tt;	
	int hollyy;
	int numt=0,namet=0;
	int x[10000],y[10000],z[10000];
	char useless,haab[8];
	cin>>n;
	
	for (i=1;i<=n;i++){
		cin>>haabd>>useless>>haab>>haaby;
		for (j=0;j<=17;j++){
			if ((haab[0]==haabs[j][0]) && (haab[1]==haabs[j][1])){
				haabm=j+1;
				break;
			}
		}
			tt=fhaab(haaby,haabm,haabd);	
			hollyy=tt/260;
			numt=0;namet=0;
			holly1=0;holly2=0;
		for (i1=1;i1<=259;i1++){
			numt++;
			namet++;
			if (numt==14) numt=1;
			if (namet==21) namet=1;
			if (tt%260==i1){
				holly1=numt;
				holly2=namet;
				break;
			}
		}
		x[i]=holly1;y[i]=holly2;z[i]=hollyy;
	}
	cout<<n<<endl;
	for (i=1;i<=n;i++){
		cout<<x[i]<<" "<<hollys[y[i]-1]<<" "<<z[i]<<endl;
	}
}

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