Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
40117 | wuxinyue | 乘方计算 | C++ | Accepted | 0 MS | 240 KB | 247 | 2024-02-07 18:35:32 |
#include <bits/stdc++.h> using namespace std; int main(){ int a; cin >> a; int n; cin >> n; int i=1; int x=a; if(n==1){ cout<<a; } else if(n!=1){ while(i<=n-1){ x=x*a; i++; } cout << x; } return 0; }