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 |
Java BigDecimalimport java.math.BigDecimal; import java.util.*; public class Main { public static void main(String[] args) throws InterruptedException { // write your code here Scanner cin = new Scanner(System.in); while(cin.hasNext()){ BigDecimal a = cin.nextBigDecimal(); int b = cin.nextInt(); String res = a.pow(b).stripTrailingZeros().toPlainString(); res = (res.indexOf("0.")==0)?(res.substring(1)):res; System.out.println(res); } } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator