使用数码管显示负温度时需要把负数转换为绝对值 #include<math.h> 使用abs 或者自己写函数 #define ABS(x) ((x)>=0?(x):-(x))) 转载于:https://www.cnblogs.com/yekongdexingxing/p/6657371.html