计算指数

题源

团体程序设计天梯赛

题解

#include<iostream>
using namespace std;
int n,num = 1;
int main(){
    cin >> n;
    for(int i = 0;i < n;i++)num*=2;
    cout << "2" << "^" << n << " = " << num << endl;
    return 0;
}
posted @ 2021-04-23 12:50  summeriver13  阅读(36)  评论(0)    收藏  举报