初学者,为什么这题5个WA啊???大佬们,求助。
查看原帖
初学者,为什么这题5个WA啊???大佬们,求助。
1066932
xinaocyy楼主2024/1/5 17:44
#include<iostream>
using namespace std;

int main(){
	int a,b;
	cin >> a >> b;
	long long ans = a;
	for(int i = 1;i <= b;i++){
		ans *= a;
	}
	if(ans <= 1000000000){
		cout << ans << endl;
	}else{
		cout << -1 << endl;
	}
	return 0;
}
2024/1/5 17:44
加载中...