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

Java 不能AC的经验

Posted by beiwei at 2016-09-26 13:28:49 on Problem 1001
第一点:
1、读数的时候要使用scanner.nextBigDecimal(),而不能使用nextDouble(),然后用new
BigDecimal()转化,这会产生误差!!!(我在这被坑了,提醒后人!)
2、decimal = decimal.pow(n).stripTrailingZeros();
String s = decimal.toPlainString();

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