c++ - C语言中,判断a+b与c的大小,if(a+b > c)为什么会判断错误?
高洛峰
高洛峰 2017-04-17 14:38:34
0
1
694
高洛峰
高洛峰

拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...

reply all(1)
黄舟

When the sum of a + b is too large, an overflow occurs. The long long here is signed long long. After overflow, it is truncated according to the number of digits of the long long, and then converted into a decimal number, which may become a negative number. Situation, then something went wrong.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template