//有符号乘法溢出判断
#include<iostream>
using namespace std;
int tmult_ok(int x, int y )
{
int pro = x*y;
return !x || pro/x == y;
}
int main()
{
unsigned int x,y,pro;
cin>>x>>y;
if (tmult_ok(x,y))
cout<<"不溢出";
else
cout<<"溢出";
return 0;
}
编程实现 有符号乘法溢出判断
猜你喜欢
转载自blog.csdn.net/weixin_45884316/article/details/105141633
今日推荐
周排行