这题要逐个循环吗?直接double就行了
2025-06-24 20:34:10
发布于:上海
1阅读
0回复
0点赞
直接pow,以下是ac代码.
#include<iostream>
#include<cmath>
#include<cstdio>
using namespace std;
int main(){
int a,b;
cin>>a>>b;
double c=pow(a,b);
if(c>pow(10,9)||c<0){
cout<<-1;
}else{
printf("%.lf",c);
}
}
这里空空如也
有帮助,赞一个