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 |
新手上路:请问为什么Compile Error? (附Java源程序)import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.math.BigDecimal; import java.util.StringTokenizer; public class Main { public static void main(String[] args) throws IOException { BufferedReader stdin = new BufferedReader(new InputStreamReader( System.in)); String line; while ((line = stdin.readLine()) != null) { StringTokenizer st = new StringTokenizer(line); BigDecimal v = new BigDecimal(st.nextToken()); int n = Integer.parseInt(st.nextToken()); System.out.println(getResult(v, n)); } } /** * @param v * @param n * @return */ private static Object getResult(BigDecimal v, int n) { return v.pow(n).toString(); } } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator