没开longlong AC了?求大佬解释
查看原帖
没开longlong AC了?求大佬解释
983373
15caoyichen楼主2023/12/16 14:46

本蒟蒻完全不理解数据溢出为什么一定是-2147483648?求大佬解释

#include<bits/stdc++.h>
using namespace std;
int main(){
	int a,b,t;
	cin >> a >> b;
	t=pow(a,b);
	if(t==-2147483648){
		cout << "-1";
		return 0;}
	cout << t;
	return 0;
}
2023/12/16 14:46
加载中...