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所有测试数据都过了,怎么还有runtime error啊~~求助!!!这是代码:不甚感激! import java.math.*; import java.util.*; public class Main { public static void main(String arg[]){ String s; BigDecimal a,c; int i,n; c=BigDecimal.valueOf(0); Scanner in=new Scanner(System.in); while(true){ a=in.nextBigDecimal(); n=in.nextInt(); c=a.pow(n); s=c.toPlainString(); for(i=s.length()-1;i>=0;i--) if(s.charAt(i)!='0')break; s=s.substring(0,i+1); if(s.charAt(0)=='0')s=s.substring(1,s.length()); System.out.println(s); } } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator