我不信有人用高精度
2025-04-22 19:43:39
发布于:广东
1阅读
0回复
0点赞
呵呵,题目没说a和b会小于0
#include <bits/stdc++.h>
using namespace std;
long long a, b;
int main(){
cin >> a >> b;
long long ans = pow(a, b);
if (ans>INT_MAX || ans<0){
cout << -1;
}
else{
cout << ans;
}
return 0;
}
这里空空如也
有帮助,赞一个