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,就1A了,放上AC代码纪念~

Posted by Snow_DUT at 2014-05-24 12:40:14 on Problem 1001
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:
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