| ||||||||||
| 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 | |||||||||
疯了完全没理由啊对于第1003题为什么这样是答案是错误的呢??
我找了运行可以通过的答案,几乎没差别啊??
求教大神啊
public class Main{
public static void main(String[] args){
String str;
float c,sum = 0;
int i;
Scanner scanner = new Scanner(System.in);
str = scanner.nextLine();
while(!str.equals("0.00")){
c = Float.valueOf(str).floatValue();
for(i=1;sum<c;i++){
sum = sum + 1f/(i+1);
}
System.out.printf("%d card(s)\n",i-1);
str = scanner.next();
}
}
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator