当前位置: 代码迷 >> C语言 >> 高精度
  详细解决方案

高精度

热度:399   发布时间:2007-10-12 15:35:12.0
高精度

Time Limit:1000MS Memory Limit:65536K
Total Submit:0 Accepted:0

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

Source

East Central North America 1988

搜索更多相关的解决方案: 高精度  computation  Limit  exact  magnitude  

----------------解决方案--------------------------------------------------------

楼主你无不无聊啊,随便找个OJ网站,一道题目复制过来发个帖子


----------------解决方案--------------------------------------------------------
把OJ 地址帖出来啊.
----------------解决方案--------------------------------------------------------
OJ是什么啊?
----------------解决方案--------------------------------------------------------

Online Judge


----------------解决方案--------------------------------------------------------

这个是PKU1001


----------------解决方案--------------------------------------------------------
。。还是字符串模拟吧
----------------解决方案--------------------------------------------------------

会做的请帮忙解决一下
希望大家帮忙 确实不会做 会做的都做了啊

[此贴子已经被作者于2007-10-16 8:04:02编辑过]


----------------解决方案--------------------------------------------------------
以下是引用心剑菩提在2007-10-13 13:53:21的发言:

会做的请帮忙解决一下 不想做的请不要说:

楼主你无不无聊啊,随便找个OJ网站,一道题目复制过来发个帖子

什么叫无聊啊 我的作业题啊

希望大家帮忙 确实不会做 会做的都做了啊

既然问作业就要谦虚求教,不要这样人身攻击,否则删帖
用数组就可以解决您的问题,建立数组A,B存储数据,然后通过模拟四则运算来实现


----------------解决方案--------------------------------------------------------
可以参照雨中飞燕的高精度算法,虽然难道,但效率很高。。。
----------------解决方案--------------------------------------------------------
  相关解决方案