| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
自己机器上可以,在它那里就runtimeErrorimport 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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator