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,就1A了,放上AC代码纪念~import java.util.*; import java.math.*; public class Main { public static void main(String args[]) { Scanner cin=new Scanner(System.in); while(cin.hasNext()) { BigDecimal a=cin.nextBigDecimal(); int b=cin.nextInt(); BigDecimal c=a.pow(b); String s=c.toPlainString().replace("0"," ").trim(); if(s.charAt(s.length()-1)=='.') s=s.replace(".", ""); System.out.println(s.replace(" ","0")); } } } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator