洛谷上测试AC 自己测有问题 求解
查看原帖
洛谷上测试AC 自己测有问题 求解
817365
qfy123楼主2022/10/30 19:38

具体问题:a=10,b=9时输出999999999

考场上a=10 b=9输出都是正常的,一回到家里测就不正常了,这是咋回事啊

附上考场代码:

#include<bits/stdc++.h>
using namespace std;
int a,b;
int main(){
//	freopen("pow.in","r",stdin);
//	freopen("pow.out","w",stdout);
	cin>>a>>b;
	if(pow(a,b)>1e9) cout<<-1;
	else{
		int kkksc03 = pow(a,b);
		cout<<kkksc03<<endl;
	}
	return 0;
}	
2022/10/30 19:38
加载中...