22839_Powers

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

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

Pro.ID

22839

Title

Powers

Title链接

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

AC

102

Submit

116

Ratio

87.93%

时间&空间限制

  • Time Limit: 400/200 MS (Java/Others)     Memory Limit: 65536/65536 K (Java/Others)
  • 描述

    Powers of two are just so easy to calculate. To find the Nth power of 2, just multiply 2 by itself N times (where 2 to the 0th power is 1 and 2 to the 1st power is 2). Thus, we have a power table:

    N     2 to the N-th power
    2            4
    5           32
    10        1024

    Write a program that reads N ( 1 ≤ N ≤ 30 ) and prints 2 to the N-th power. Do not use a table of precalculated numbers in your program.

    输入

    A single line with integer N.

    输出

    Description

    Powers of two are just so easy to calculate. To find the Nth power of 2, just multiply 2 by itself N times (where 2 to the 0th power is 1 and 2 to the 1st power is 2). Thus, we have a power table:

    N     2 to the N-th power
    2            4
    5           32
    10        1024

    Write a program that reads N ( 1 ≤ N ≤ 30 ) and prints 2 to the N-th power. Do not use a table of precalculated numbers in your program.

    Input

    A single line with integer N.

    Output

    A single line with 2 to the N-th power.

    Sample Input

    10

    Sample Output

    1024

    Source

    样例输入

    10

    样例输出

    1024

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部