求助
查看原帖
求助
1175242
Zxx20120715楼主2024/10/3 11:44
#include<bits/stdc++.h>
using namespace std;
int a,b,ans=1;
int main(){
	cin>>a>>b;
	if(a==1){
		cout<<1;
		return 0;
	}
	for(int i=1;i<=b;i++){
		ans*=a;
		if(ans>1e9){
			cout<<-1;
			return 0;
		}
	}
	cout<<ans;
	return 0;
}

(注:从 2024.3.20 拖到了现在才发的。。。)

此代码 9090 分(过了样例),测试点 #8 输出 00(答案是 11),求助各位dalao!

2024/10/3 11:44
加载中...