#t215. 计算 2 的幂

计算 2 的幂

Power of 2

Problem Description

Given a non-negative integer  n \,n\,, compute  2n \,2^n\,.

Input Format

One integer  n \,n\, (0≤n≤310 \le n \le 31).

Output Format

One integer: 22 raised to the  n\,n-th power.

Sample Input

3

Sample Output

8

Hint

  • In C++, ^ is not exponentiation — it is the bitwise XOR operator, so using it is guaranteed wrong.
  • nn is at most 3131, and 231=21474836482^{31} = 2147483648, while the upper bound of int is 21474836472147483647 — off by exactly 11! Think about which type is safe to use.
  • The approach is simply to multiply by 22 a total of nn times.