22478_Exponentiation

2022-5-16 18:22| 发布者: Hocassian| 查看: 28| 评论: 0|原作者: 肇庆学院ACM合集

摘要:
C:\Users\Administrator\Downloads\2019-10-12-10-14-5-89506476823099-Problem List-采集的数据-后羿采集器.html

Pro.ID

22478

Title

Exponentiation

Title链接

http://10.20.2.8/oj/exercise/problem?problem_id=22478

AC

8

Submit

12

Ratio

66.67%

时间&空间限制

  • Time Limit: 800/400 MS (Java/Others)     Memory Limit: 32768/32768 K (Java/Others)
  • 描述

    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.

    输入

    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.

    输出

    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 Rn. 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)
    {
    ...
    }

    c :
    while(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    */
    {
    ...
    }

    Source

    样例输入

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

    样例输出

    548815620517731830194541.899025343415715973535967221869852721
    .00000005148554641076956121994511276767154838481760200726351203835429763013462401
    43992025569.928573701266488041146654993318703707511666295476720493953024
    29448126.764121021618164430206909037173276672
    90429072743629540498.107596019456651774561044010001
    1.126825030131969720661201

    提示

    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)
    {
    ...
    }

    c :
    while(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    */
    {
    ...
    }


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部