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

忘记float吧,用double

Posted by frkstyc at 2006-03-08 01:03:12 on Problem 1003
In Reply To:我用java编的 类名我该定义成什么啊 Posted by:ppxieppp at 2006-03-08 01:01:43
> import java.util.*;
> public class Main{
> 	public static void main(String argc[]){
> 		 float a =0 ;
> 		 float b =0 ;
> 		Scanner cin = new Scanner(System.in);
> 		a = cin.nextFloat();
>         	    int c = 0;
> 	 
> 		for(float i = 1; b < a; i++){
> 			b = b + 1/(i+1);
> 			c = (int)i;
> 		
> 		}
> 		System.out.println(c+" card(s)");
> 	
> 		}
> 		
> 
> 		
> }

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