HDU 1063 exponentiation large number

Source: Internet
Author: User

Problem descriptionproblems involving the computation of exact values of very large magnstrap and precision are common. For example, the computation of the national debt is a taxing experience for your 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.

Inputthe 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.

Outputthe output will consist of one line for each line of input giving the exact value of R ^ n. leading zeros shocould 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 120.4321 205.1234 156.7592 998.999 12

Sample output
 strong  requires the N power of a Large Number A, but there are still several conditions. For example, if the number is 0 before the decimal point, delete the code. : 
 Import Java. math. bigdecimal; import Java. util. extends; public class main {public static void main (string [] SRGs) {using CIN = new using (system. in); bigdecimal A, s; int I, n; while (CIN. hasnext () {A = cin. nextbigdecimal (); n = cin. nextint (); s = A; for (I = 1; I 
     
     

large numbers of HDU 1063 exponentiation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.