poj1001的java实现
来源:互联网 发布:中国历年外汇储备数据 编辑:程序博客网 时间:2024/05/13 17:56
import java.util.Scanner;
import java.math.*;
public class Main1{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
//如果不断有输入,则不断执行循环体里面的代码
while (sc.hasNext()) {
//以下i行代码将bigInteger转化成bigDecimal
BigDecimal bd = new BigDecimal(sc.next());
// 返回其值为 (thisn) 的 BigDecimal,准确计算该幂,使其具有无限精度。
BigDecimal result = bd.pow(sc.nextInt());
//1)stripTrailingZeros().返回数值上等于此小数,但从该表示形式移除所有尾部零的 BigDecimal。
//2)toPlainString().返回不带指数字段的此 BigDecimal 的字符串表示形式。
String s = result.stripTrailingZeros().toPlainString();
if(s.startsWith("0"))
s=s.substring(1);
System.out.println(s);
}
}
}
- poj1001的java实现
- poj1001 Exponentiation(JAVA实现)
- poj1001 java
- poj1001 大数的幂 java的用法
- JAVA 处理 大数 POJ1001
- java高精度 poj1001
- java高精poj1001
- poj1001大数乘方java
- poj1001 java 大数
- poj1001 + 高精度的心得
- POJ1001
- poj1001
- poj1001
- POJ1001
- POJ1001
- poj1001
- POJ1001
- poj1001
- 入侵samba服务器失败
- C#将数据转成图形报表
- 网页设计中的细节
- 《算法导论》中广度优先搜索的实现 c++
- document方式解析xml文件
- poj1001的java实现
- hdu 1114 Piggy-Bank
- hdu 1063 Exponentiation
- Android自定义View基础
- keystore相关 (java)
- hdu 1405 The Last Practice
- hdu 1160 FatMouse's Speed
- C语言的编译链接过程的介绍
- 几篇非常好的Oracle Cost Management文章