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

自己机器上可以,在它那里就runtimeError

Posted by jibimily at 2007-09-08 13:12:20 on Problem 1003
import java.io.*;
import java.util.*;
public class Main
{
 
	public static void main(String args[]) throws Exception
	{
		int j = 2;
		float a = 10f;
		int count = 0;
		int i = 0;
		float num = 0.0f;
		float[] b = new float[50];
		while( a != 0.0f)
		{
			BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
			a = Float.parseFloat(br.readLine());
			if(a==0.0 | a>0.01 | a<5.20)
			{
				while(num<a)
				{
					num = num + 1f/j;
					j++;
					count++;
				}
				b[i] = count;
				count = 0;
				num = 0;
				j=2;
				i++;
				//br.close();
			}
			else break;
		}
			int x =0;
			while(b[x] != 0.0f)
			{
				System.out.println((int)b[x]+" card(s)");
				x++;
			}
		
	}
}

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