点击打开链接

Exponentiation
Time Limit: 500MS   Memory Limit: 10000K
Total Submissions: 178771   Accepted: 43115

Description

Problems involving the computation of exact values of very large magnitude and precision are common. For example, the computation of the national debt is a taxing experience for many computer systems.

This problem requires that you write a program to compute the exact value of Rn where R is a real number ( 0.0 < R < 99.999 ) and n is an integer such that 0 < n <= 25.

Input

The input will consist of a set of pairs of values for R and n. The R value will occupy columns 1 through 6, and the n value will be in columns 8 and 9.

Output

The output will consist of one line for each line of input giving the exact value of R^n. Leading zeros should be suppressed in the output. Insignificant trailing zeros must not be printed. Don't print the decimal point if the result is an integer.

Sample Input

95.123 12
0.4321 20
5.1234 15
6.7592  9
98.999 10
1.0100 12

Sample Output

548815620517731830194541.899025343415715973535967221869852721
.00000005148554641076956121994511276767154838481760200726351203835429763013462401
43992025569.928573701266488041146654993318703707511666295476720493953024
29448126.764121021618164430206909037173276672
90429072743629540498.107596019456651774561044010001
1.126825030131969720661201

Hint

If you don't know how to determine wheather encounted the end of input: 
s is a string and n is an integer

C++while(cin>>s>>n){...}cwhile(scanf("%s%d",s,&n)==2) //to  see if the scanf read in as many items as you want/*while(scanf(%s%d",s,&n)!=EOF) //this also work    */{...}

试着用java做大数的题,会很方便!!!

import java.math.*;
import java.util.Scanner;
import java.math.BigDecimal;public class Main{public static void main(String args[]) {Scanner sc = new Scanner(System.in);while(sc.hasNextBigDecimal()) {BigDecimal a = sc.nextBigDecimal();int n = sc.nextInt();BigDecimal c=a.pow(n);
//          BigDecimal 这个里边没有*c=c.stripTrailingZeros();//去掉末尾多余的0String ss = c.toPlainString();//不用科学计数法,正常表示if(ss.startsWith("0.")){ss=ss.substring(1);
//              "unhappy".substring(2) returns "happy"}System.out.println(ss);}}
}

poj 1001 Exponentiation(java)相关推荐

  1. LDAP查询数据(JAVA)

    文章目录 前言 一.LDAP是什么? 二.使用JAVA连接LDAP 1.引入工具类 2.使用官方提供得方式 总结 前言 公司让从ldap中查询对应得数据,去验证用户得信息,以前没接触过ldap,找了找 ...

  2. 常惠琢 201771010102《面向对象程序设计(java)》第七周学习总结

    实验七 继承附加实验 实验时间 2018-10-11 1.实验目的与要求 (1)进一步理解4个成员访问权限修饰符的用途: (2)掌握Object类的常用API用法: (3)掌握ArrayList类用法 ...

  3. 建立与ftp服务器的连接——完成版(java)

    建立与ftp服务器的连接--完成版(java) // ftp 程序Ftp.java // 此程序的功能是建立与ftp服务器的连接并实现文件传输 // 使用方法:java Ftp 服务器地址 //启动示 ...

  4. 海康摄像头的二次开发(java)

    海康摄像头的二次开发(java) 我第一次接触海康摄像头的二次开发的项目,一开始的时候摸不清套路,走了不少弯路,现在准备把我的一些经验留下来,让大家参考一下. 1.首先到海康的官网下载设备网络SDK: ...

  5. 《编程导论(Java)#183;1.4.1 范式》

    这个楼主,是我的学生么?2013年写的! 嗯."编程范式或许是学习不论什么一门编程语言时要理解的最重要的术语".这句话早在2005年出版<Java程序设计>(宋中山,严 ...

  6. 201771010106东文财《面向对象程序设计(java)》实验12

    实验十二  图形程序设计 实验时间 2018-11-14 1.实验目的与要求 (1) 掌握Java GUI中框架创建及属性设置中常用类的API: (2) 掌握Java GUI中2D图形绘制常用类的AP ...

  7. POJ 3414 Pots(罐子)

    POJ 3414 Pots(罐子) Time Limit: 1000MS    Memory Limit: 65536K Description - 题目描述 You are given two po ...

  8. 2018面向对象程序设计(Java)第3周学习指导及要求

    2018面向对象程序设计(Java) 第3周学习指导及要求(2018.9.11-2018.9.16)   学习目标 适应老师教学方式,能按照自主学习要求完成本周理论知识学习: 掌握Java Appli ...

  9. 一些面试题(JAVA)

    一些面试题(JAVA) 01.通过什么参数分配Java内存使用? java -Xms128m -Xmx512m 02.Treemap和Hashmap区别是什么? TreeMap对Key进行排序,而Ha ...

最新文章

  1. H265与ffmpeg改进开发
  2. 你想过 Controller 这些方法里的参数是如何工作的吗?
  3. python职能-python随机模块22个函数详解(下)
  4. NLP—word2vec词向量简介
  5. 多线程情况下创建连接池
  6. Ogre 1.7 构建编译
  7. 挑战程序设计竞赛部分题目选择排序、二分查找找出下标、深度优先算法、求三角形max周长、蚂蚁算法、操作excel
  8. 3399 mysql_手动安装 mysql
  9. Visual Studio [即时窗口] [命令窗口] (Immediate Window Command Window) 转
  10. Python Lex Yacc手册
  11. 信号检测与估计c语言,清华大学出版社-图书详情-《信号检测与估计(第2版)》...
  12. 广州市印发《关于促进大数据发展的实施意见》
  13. 电力系统谐波分析代码
  14. 马克思主义哲学笔记(四)
  15. 自然辩证法对计算机科学技术的应用,自然辩证法在计算机科学技术中的应用.doc...
  16. html5 css3冷色调渐变色特效
  17. 瑞思拜 我儿豁 SpringMVC基础 兄弟们冲冲冲
  18. paddlepaddle 人脸识别爬坑指南
  19. 使用360加固保加固安卓APK
  20. 加拿大PCI GXL地理成像加速器-地理国情大显身手

热门文章

  1. Volume was not properly unmounted. Some data may be corrupt
  2. 如何利用石墨文档进行团队协作
  3. [更新ing]sklearn(十六):Nearest Neighbors *
  4. 火车头dede采集接口,图片加水印,远程图片本地化,远程无后缀的无图片本地化...
  5. Acrel-2000Z变电站综合自动化系统
  6. --仿蓝色理想网站的导航菜单--
  7. 全国计算机考试第五套,计算机等级一级MS Office考试考题:第五套字处理题
  8. 移动互联网安全技术研究
  9. 杀怪物(dfs)题解
  10. 饿了么美团外卖cps返利系统外卖返利公众号搭建cps系统小程序SaaS源码