#include<bits/stdc++.h> using namespace std; int add(int a,int n) { int b=a; for(int i=1;i<n;i++) { a=a*b; } return a; } int main() { int a,n; cin>>a>>n; cout<<add(a,n); return 0; }
#include<bits/stdc++.h> using namespace std; void hanshu(int shu,int cishu) { int l; l=shu; for(int i=1;i<cishu;i++) { l=shu*l; } cout<<l; } int main() { //反正不是神,就来刷吗吧!!! int shu,cishu; cin>>shu>>cishu; hanshu(shu,cishu); return 0; }
```cpp #include<bits/stdc++.h> using namespace std; int main(){ //还是要撸代码的,神。 int a,n,A; cin>>a>>n; A=a; while(n-1){ a*=A; n--; } cout<<a; return 0; }
注册一个 安阳中心OJ 通用账户,您就可以在我们提供的所有在线评测服务上提交代码、参与讨论。
使用您的 安阳中心OJ 通用账户