Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
216 | ZRH | x的n次方 | C++ | Accepted | 0 MS | 260 KB | 429 | 2022-07-22 10:06:12 |
#include<iostream> //输入函数库 #include<iomanip> #include<cmath> //数学函数库 #include<cstdio> #include<ctime> #include<cstring> #include<cstdlib> #include<string> #include<stdlib.h> #include<sys/time.h> using namespace std; long long t(int x,int n){ if(n==0){ return 1; } else{ n--; return t(x,n)*x; } } int main(){ int x,n; cin>>x>>n; cout<<t(x,n); return 0; }