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