L1-012 计算指数

题目 L1-012 计算指数

image-f27de122

思路分析

代码实现

#include<bits/stdc++.h>
using namespace std;
#define endl '\n'

int main()
{
	ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
	int n;cin>>n;
	long long res=2;
	for(int i=0;i<n-1;i++)	res*=2;
	cout<<"2^"<<n<<" = "<<res;
	return 0;
}

同类题型

视频讲解


⬅️ L1-011 A-B 🏠 00-天梯赛 ➡️ L1-013 计算阶乘和