真的没骗你,这道才是简单题 —— 对任意给定的不超过 10 的正整数 n,要求你输出 2n。不难吧?
Input Specification:
输入在一行中给出一个不超过 10 的正整数 n。
Output Specification:
在一行中按照格式2^n^ = 计算结果
输出 2n的值。
Sample Input:
5
Sample Output:
2^5 = 32
Code:
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
int res;
res=pow(2,n);
cout<<"2^"<<n<<" = "<<res;
return 0;
}