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

为什么会run time error !!!!

Posted by newlala at 2004-10-29 19:55:40 on Problem 1008
import java.io.*;
import java.util.*;
public class pku1008 {

	public static void main(String[] args) throws Exception{
		BufferedReader in =new BufferedReader(
				new InputStreamReader(System.in));
		int i,j,k,sum,n,d1,y1,m2,y2;
		String s,m1,d2;
		StringTokenizer st;
		String haab[],holly[];
		haab=new String [19];
		holly=new String[20];
		
		holly[0]=new String("imix");
		holly[1]=new String("ik");
		holly[2]=new String("akbal");
		holly[3]=new String("kan");
		holly[4]=new String("chicchan");
		holly[5]=new String("cimi");
		holly[6]=new String("manik");
		holly[7]=new String("lamat");
		holly[8]=new String("muluk");
		holly[9]=new String("ok");
		holly[10]=new String("chuen");
		holly[11]=new String("eb");
		holly[12]=new String("ben");
		holly[13]=new String("ix");
		holly[14]=new String("mem");
		holly[15]=new String("cib");
		holly[16]=new String("caban");
		holly[17]=new String("eznab");
		holly[18]=new String("canac");
		holly[19]=new String("ahau");
		
		
		haab[0]=new String("pop");
		haab[1]=new String("no");
		haab[2]=new String("zip");
		haab[3]=new String("zotz");
		haab[4]=new String("tzec");
		haab[5]=new String("xul");
		haab[6]=new String("yoxkin");
		haab[7]=new String("mol");
		haab[8]=new String("chen");
		haab[9]=new String("yax");
		haab[10]=new String("zac");
		haab[11]=new String("ceh");
		haab[12]=new String("mac");
		haab[13]=new String("kankin");
		haab[14]=new String("muan");
		haab[15]=new String("pax");
		haab[16]=new String("koyab");
		haab[17]=new String("cumhu");
		haab[18]=new String("uayet");
		
		s=in.readLine();
		n=Integer.parseInt(s);
		System.out.println(n);
		for(i=0;i<n;i++)
		{
			sum=0;
			s=in.readLine();
			st=new StringTokenizer(s," \t\n\r\f.");
			d1=Integer.parseInt(st.nextToken());
			m1=st.nextToken();
			y1=Integer.parseInt(st.nextToken());
			sum=sum+y1*365;
			for(j=0;j<18;j++)
			{
				if(m1.equals(haab[j]))
					break;
			}
			
			sum=sum+j*20;
			sum=sum+d1+1;
			y2=sum/260;
			sum=sum-y2*260;
			m2=sum%13;
			k=sum%20;
			d2=holly[k-1];
			
			System.out.println(m2+" "+d2+" "+y2);
		}
		
		
		
		
		
	}
}

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