90分,不知道差哪里,求大佬相助!!!
查看原帖
90分,不知道差哪里,求大佬相助!!!
956316
77Glorious楼主2023/8/31 21:36
#include<bits/stdc++.h>
using namespace std;
double x;

int main(){
	int a,b,cnt=1;

	cin>>a>>b;
	if(a==1){cout<<1; return 0;}
	
	for(int i=1;i<=b;i++){
		cnt=cnt*a;
		if(cnt>pow(10,9)){
			cout<<"-1"; return 0;
		}
	}
	
	cout<<cnt;
	

	
	return 0;
	
	
}
2023/8/31 21:36
加载中...