| ||||||||||
| 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 | |||||||||
忘记float吧,用doubleIn 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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator