POJ-1001 Exponentiation 高精度
来源:互联网 发布:网络理财诈骗案 编辑:程序博客网 时间:2024/05/01 20:51
计算大实数R^n的值。
import java.io.*;import java.math.*;import java.util.*;import java.text.*;public class Main {public static void main(String[] args) {Scanner cin = new Scanner(System.in);BigDecimal num;//定义一个大实数int ep,sta, end, i;String st;while(cin.hasNext()/*相当于C++的!=EOF*/) {num = cin.nextBigDecimal(); //底数ep = cin.nextInt(); //指数num = num.pow(ep); //计算num^epst = new String(num.toPlainString()); //转为字符串sta = 0;while(st.charAt(sta) == '0') sta++; //去掉前缀的0end = st.length() -1;while(st.charAt(end)=='0') end--; //去掉后缀的0if(st.charAt(end)=='.') end--; //若小数点后没0,去掉for(i=sta; i<=end; i++)System.out.print(st.charAt(i));System.out.println();}System.exit(0);}}
- POJ-1001 Exponentiation 高精度
- Exponentiation - POJ 1001 高精度
- poj 1001 (Exponentiation) 高精度乘法
- poj 1001 Exponentiation 高精度乘方
- 【POJ】 1001-Exponentiation 【高精度乘法】
- POJ 1001 Exponentiation (Java高精度)
- POJ 1001 Exponentiation 高精度乘法
- POJ 1001 Exponentiation 高精度指数
- poj 1001 Exponentiation 高精度乘法
- poj 1001 Exponentiation(高精度乘法)
- poj 1001 Exponentiation 高精度
- POJ 1001 Exponentiation - 高精度高位数运算
- poj 1001Exponentiation||nyoj 155 高精度幂
- 20140709 【高精度浮点数】POJ 1001 Exponentiation
- poj 1001 Exponentiation(求高精度幂)
- POJ 1001 Exponentiation 求高精度幂
- POJ 1001 Exponentiation (高精度/大数乘法)
- poj 1001 Exponentiation(高精度运算)
- 如何:使用 DataGridView 控件显示数据
- 更多关于矩阵和队列
- 常用JS
- 关于JAVA的值传递和引用传递&String
- javascript数组的方法
- POJ-1001 Exponentiation 高精度
- poj 3390 DP
- [88]Merge Sorted Array
- 【技术类】【且听我说“镶嵌数据集”】10、镶嵌数据集影像管理与应用示例(完)
- uva10158
- DLL的灾难---DEBUG与RELEASE版本不能交叉调用
- js xml实现全国地区级联(Firefox IE Chrome)
- Python完全新手教程
- JS关闭窗口不提示或JS关闭页面的几种方法